Skip to content

Instantly share code, notes, and snippets.

@arun12209
Created June 26, 2022 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arun12209/86493c74b4e495d00d7ae693eca417f2 to your computer and use it in GitHub Desktop.
Save arun12209/86493c74b4e495d00d7ae693eca417f2 to your computer and use it in GitHub Desktop.
ContactTriggerHandler.cls
public without sharing class ContactTriggerHandler implements TriggerHandler{
private boolean triggerIsExecuting;
private integer triggerSize;
public ContactTriggerHelper helper;
public ContactTriggerHandler(Boolean triggerIsExecuting, integer triggerSize) {
this.triggerIsExecuting = triggerIsExecuting;
this.triggerSize = triggerSize;
this.helper = new ContactTriggerHelper();
}
public void beforeInsert(List<Contact> newContacts){
//call ContactTriggerHandler methods
helper.updateContactAddresses(newContacts);
}
public void beforeUpdate(List<Contact> newContacts, List<Contact> oldContacts, Map<Id,sObject> newContactMap, Map<Id,sObject> oldContactMap){
//call ContactTriggerHandler methods
}
public void beforeDelete(List<Contact> oldContacts, Map<Id,SObject> oldContactMap){
//call ContactTriggerHandler methods
}
public void afterInsert(List<Contact> newContacts, Map<Id,SObject> newContactMap){
//call ContactTriggerHandler methods
}
public void afterUpdate(List<Contact> newContacts, List<Contact> oldContacts, Map<Id,SObject> newContactMap, Map<Id,SObject> oldContactMap){
//call ContactTriggerHandler methods
}
public void afterDelete(List<Contact> oldContacts, Map<Id,SObject> oldContactMap){
//call ContactTriggerHandler methods
}
public void afterUndelete(List<Contact> newContacts, Map<Id,SObject> newContactMap){
//call AccountTriggerHelper methods
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment