Created
February 4, 2020 03:44
-
-
Save melissajhansen/cab13f40c0136aa4b3b5a134d3d1af92 to your computer and use it in GitHub Desktop.
Recipe Trigger Example
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 RecipeTrigger on Recipe__c (before insert, after insert, before update, after update) { | |
RecipeUtil rUtil = new RecipeUtil(trigger.new, trigger.newMap, trigger.oldMap); | |
if (Trigger.isBefore) { | |
if (Trigger.isInsert) { | |
rUtil.onBeforeInsert(); | |
} else if (Trigger.isUpdate) { | |
rUtil.onBeforeUpdate(); | |
} | |
} | |
else if (Trigger.isAfter) { | |
if (Trigger.isInsert) { | |
rUtil.onAfterInsert(); | |
} else if (Trigger.isUpdate) { | |
rUtil.onAfterUpdate(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment