Skip to content

Instantly share code, notes, and snippets.

@kevinohara80
Last active August 29, 2015 14:01
Show Gist options
  • Save kevinohara80/a2136d12960a3539404d to your computer and use it in GitHub Desktop.
Save kevinohara80/a2136d12960a3539404d to your computer and use it in GitHub Desktop.
Basic trigger implementation - all contexts
trigger OpportunityTrigger on Opportunity (after insert, after update) {
if(Trigger.isAfter() && Trigger.isInsert()) {
OpportunityTriggerHandler.handleAfterInsert(Trigger.new);
} else if(Trigger.isAfter() && Trigger.isUpdate()) {
OpportunityTriggerHandler.handleAfterInsert(Trigger.new, Trigger.old);
}
}
public class OpportunityTriggerHandler {
public static void handleAfterInsert(List<Opportunity> opps) {
// handler logic
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment