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
Anthony PiaiaAnthony Piaia 

Does anyone have sample code on how to write an Apex Trigger in order to update all Standard Picklist field values from a custom picklist

I am new to triggers and have never written in Apex, can anyone point me in the write direction or does anyone have sample code in order to update a standard picklist field with all the values from a custom picklist field, i've read that this is they way to go in order to update a standard picklist with a custom picklist. I attempted to do this with a worklow in order to do a field update but i am only able to select one of the picklist values and i need to pass all the values.

Please help!!!  Thank you
kaustav goswamikaustav goswami
Hi,

Can you please give an example as to what is it that you are trying to do. That will help me to understand and write a relevant sample code.

Thanks.
Anthony PiaiaAnthony Piaia
I have lead statuses that need to be dependent on phases but they are not dependent on phases(custom field) because that status field in SF is a standard field and i can't use a workflow to update a standard field with a custom field.  Our idea was to create a another custom field (lead statuses) this field will be uses to create a workflow in order to have lead status dependent on phases and then use the custom fied (lead status picklist) to update the standard field picklist.