Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<Schema.PicklistEntry> picklistValues = Lead.fields.Lead_City__c.getDescribe().getpicklistvalues();
- set<string> LeadCityValues = new set<string>();
- for(Schema.PicklistEntry value : picklistValues){
- LeadCityValues.add(value.getLabel());
- }
- for( Lead ld : Trigger.new ) { if( ld.Lead_City__c != null && !(LeadCityValues.contains(ld.Lead_City__c)) ){
- ld.Other_Lead_City__c = ld.Lead_City__c;
- ld.Lead_City__c = 'Others'; } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement