Last active
August 29, 2015 14:01
-
-
Save kevinohara80/a2136d12960a3539404d to your computer and use it in GitHub Desktop.
Basic trigger implementation - all contexts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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