function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Changing default picklist values



I want to specify different default picklist values on a field called "Market" on a custom object according to the value of a field called "billing market" on the related account. The custom object is the detail of a master detail relationship with account.


Does anyone know if this is something you can do with a trigger?


Is there any way to make the default picklist value vary according to another parameter?




If you define different Record Types for an object, each record type can have different Picklist values for a given field.   So, you could define two record types for the custom object, one with one default for "Market", and the other with a different default.  Then your trigger on the related Account could change the record type of the custom object record.  (Note that it won't change the value that's already stored in that record.)   You should also see if a workflow rule will accomplish the change instead of a trigger.


Best, Steve.


Hi Steve,

Thanks for the suggestion. Unfortunately I would have to have  over  20 record types for the different markets, so it might not be  manageable.


I've tried playing around with workflow rule, but as you don't have the option to use formulas when it comes to updating a picklist field, it is not flexible enough.





I'm not using record types, and I'm having the same issue.  Any ideas?