I need to populate some picklist value on an Opportunity Trigger.

There are two pickList : 'PickList1' and 'PickList2' . Both of them are on same Opportunity Object, 2nd one is the dependent on the earlier.

When I populate PickList1 on the trigger, how can I get the relevent value of 'PickList2' ?

I know by using If statement and by using hard code Picklist value we can implement our logic. But thing is we don't want to hard code the value of Picklist.

Is there any solution?

  • Is there a reason why you are not using out of box dependent pick lists? Are these 2 picklists on 2 diff objects, if they are then taking custom setting option would help you keep the picklist mapping more under control than hardcoding values – Rao Jul 28 '14 at 18:41
  • @rao : No, they are 2 fields of Same Object. – SFDC Geek Jul 28 '14 at 18:47
  • why are you using triggers then, can you not go dependent picklist route? – Rao Jul 28 '14 at 18:47
  • A quick search reveals the answer: salesforce.stackexchange.com/questions/4462/… – Eric Jul 28 '14 at 18:49

Browse other questions tagged or ask your own question.