Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class AccountTriggerHandler {
//After Insert Handler
public class AccountAfterInsertHandler implements MyTriggers.Handler{
public void handle(){
System.Debug(LoggingLevel.INFO,'Inside AccountAfterInsertHandler');
}
}
//Before Insert Handler
public class AccountBeforeInsertHandler implements MyTriggers.Handler{
public void handle(){
System.Debug(LoggingLevel.INFO,'Inside AccountBeforeInsertHandler');
//Hold Trigger Context Variables
List<Account> allNewAccounts = Trigger.new;
for(Account singleAccount : allNewAccounts){
if(singleAccount.Rating == 'Hot'){
singleAccount.Active__c = 'Yes';
singleAccount.CustomerPriority__c = 'Medium';
}
}
}
}
//Before Update Handler
public class AccountBeforeUpdateHandler implements MyTriggers.Handler{
public void handle(){
System.Debug(LoggingLevel.INFO,'Inside AccountBeforeUpdateHandler');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.