Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. List<Schema.PicklistEntry> picklistValues = Lead.fields.Lead_City__c.getDescribe().getpicklistvalues();
  2. set<string> LeadCityValues = new set<string>();
  3. for(Schema.PicklistEntry value : picklistValues){
  4. LeadCityValues.add(value.getLabel());
  5. }
  6.  
  7. for( Lead ld : Trigger.new ) { if( ld.Lead_City__c != null && !(LeadCityValues.contains(ld.Lead_City__c)) ){
  8. ld.Other_Lead_City__c = ld.Lead_City__c;
  9. ld.Lead_City__c = 'Others'; } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement