Created
May 31, 2013 15:42
-
-
Save mxalix258/5685878 to your computer and use it in GitHub Desktop.
Check if field value is contained in a defined set, and update the field.
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 OnboardingEvacSectionUpdate on On_Off_Boarding__c (before insert, before update){ | |
List <On_Off_Boarding__c> obToUpdate = new List <On_Off_Boarding__c> (); | |
//New set is defined that contains the values 202, 0-203A, etc | |
Set <String> s1 = new Set<String>{'202', '0-203A'}; | |
For(On_Off_Boarding__c ob: Trigger.new){ | |
// Checks if Desk_location1__c is in the set s1, and updates the field | |
if (s1.contains(ob.Desk_location1__c)) { | |
ob.Evacuation_Section__c = '2N'; | |
} | |
} | |
Update obToUpdate; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment