Created
March 27, 2021 19:02
-
-
Save melissajhansen/5892ffa7c8a8ef40b8380824da70200a to your computer and use it in GitHub Desktop.
A simple, static Trigger Handler for the Recipe Trigger
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 with sharing class RecipeUtil { | |
public static void handleBeforeInsert(List < Recipe__c > newRecipes) { | |
for (Recipe__c rec : newRecipes) { | |
if (rec.Name==null || rec.Active_Time__c==null || rec.Description__c==null || rec.Active_Time_Units__c==null || rec.Servings__c==null) { | |
rec.Draft__c = true; | |
} | |
} | |
} | |
public static void handleAfterInsert(List < Recipe__c > newRecipes) { | |
} | |
public static void handleBeforeUpdate(List < Recipe__c > updatedRecipes, Map < Id, Recipe__c > oldRecMap) { | |
} | |
public static void handleAfterUpdate(List < Recipe__c > updatedRecipes, Map < Id, Recipe__c > oldRecMap) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment