Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public with sharing class RecipeTriggerHandler {
- //store data to update in list
- // -----------Trigger Handler Class Variables -----------------------------------------------
- List<Recipe__c> newRecipes;
- public static void handleBeforeUpdateInsert(List<Recipe__c> newRecipes){
- for (Recipe__c recipe : this.newRecipes) {
- //duration logic - if less than 30 minutes, Quick
- if (recipe.active_time__c <= 30 && recipe.Active_Time_Units__c == 'Minutes') {
- recipe.duration__c = 'Quick';
- //duration logic - if 30-60 min, Medium - && evaluated before ||, so order should be good here?
- } else if ((recipe.active_time__c > 30 && recipe.active_time__c <=60 && recipe.Active_Time_Units__c == 'Minutes')
- || (recipe.active_time__c = 1 && recipe.Active_Time_Units__c =='Hours')) {
- recipe.duration__c = 'Medium';
- //duration logic - if more than 1 hr, Long
- } else {
- recipe.duration__c = 'Long';
- }
- } }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement