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.
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.