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
GordyGoogleGordyGoogle 

Adding/Deleting Picklist Values in a Custom Field on the Lead Object

I have a picklist field in the Lead object called sales_Rep__c that contains a number of values that are segregated by Lead Record Type.  The organization wants to use this methodology rather than a lookup field.  So my hands are tied.

 

What I want to do is to change the values in this picklist when another custom field called Vendor_Role__c is changed in a  User object record.

 

I need to be able t add to this picklist and delete values from it.

 

Is there any way to perform this function from with a trigger on the User object?

 

I'm not sure how to access the Lead field metadata.

 

Thanks.

bob_buzzardbob_buzzard

You can't access this kind of metadata through Apex I'm afraid.

 

However, you can have different picklist values available based on the record type.  If you click into the configuration page for a particular record type, at the bottom you'll see 'picklists available for editing'.  You should then be able to define the values from the master set that should be displayed for this record type.