When deploying picklist fields between orgs, you may encounter the following error:
Cannot change which global value set this picklist uses
Why does this happen?
This is a Salesforce platform limitation. Salesforce does not allow an existing picklist field to be converted from a standard (local) picklist to one that uses a Global Value Set, or to switch between different Global Value Sets.
A common scenario: the picklist field in your source org has been converted to use a Global Value Set, but the same field in your target org is still using a standard picklist. When Gearset (or any deployment tool) attempts to deploy this change, Salesforce rejects the operation with the above error.
The Metadata API does not support converting a standard picklist field into a global picklist in place. Because of this, the field will need to be recreated manually in the target org, there is no way to do this via a deployment.
For more information on deploying picklist fields, see our guide on deploying Global Picklist Value Sets in Salesforce.
Workaround:
You will need to manually convert the field in the target org:
Create a new picklist field in the target org using the desired Global Value Set.
Remove the old field (the standard picklist field).
Rename the new field so its API name matches the original field name exactly.
โ ๏ธ Important: Deleting a field is irreversible. Always take a metadata backup before making structural changes to your target org. You may use Gearset Backup to snapshot your org before proceeding.
Disclaimer: This error is returned by Salesforce directly, rather than Gearset. Even so, we offer guidance based on our combined experience with the Metadata API. Where possible, we try to help guide you to fix or avoid this error. In the case that this isn't possible, we may need to direct you to Salesforce support for further clarification.
