How can we upsert data to global picklist value by using apex?
I wanna catch record data from custom object by soql in apex, and upsert the data to global picklist value.
Thank you in advance.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
You would want to use the
GlobalValueSet metadata, and it is accessible via the Metadata API.
To make updates to the metadata via apex, you can use the FinancialForce Metadata API Wrapper. Here is the repo.
Having said that, be careful in doing this. you could introduce some unintented regression and can create data quality issues.