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
KunlunKunlun 

Is it possible to add values in picklist field via apex api?

I have a picklist field "MeetingType" in Opportunity object. It has 3 values, such as xxx, yyy, zzz.

 

I want to add or delete the picklist values in apex class.

 

Is it possible to add value "mmm" or delete "zzz" in this picklist field via apex metadata api?

 

Thanks

gm_sfdc_powerdegm_sfdc_powerde
Picklist values are part of application metadata and cannot be changed from Apex.  You can, however, use metadata API from outside the platform to do this.
KunlunKunlun
Can we use ajax to update it with metadata?