All Collections
Troubleshooting
Salesforce validation errors
Resolving validation errors - "Picklist value: <xxx> in picklist: <yyy> not found."
Resolving validation errors - "Picklist value: <xxx> in picklist: <yyy> not found."

Validation error "Picklist value: <xxx> in picklist: <yyy> not found." was surfaced during a deployment

Quinn Kuiper avatar
Written by Quinn Kuiper
Updated over a week ago

Explanation of the error:

This Salesforce error that Gearset is surfacing is usually encountered when deploying a picklist or a new value for a picklist.

This is because the metadata that Salesforce uses doesn’t quite line up to what the Salesforce UI would lead you to believe. An example of this is picklist values on standard fields; for instance, the values of the 'Account Source' field on the Account standard object.

The Salesforce UI makes it look as if the field actually stores the value, but the reality is that the values are stored in another metadata type called a Standard value set and the actual field definition for 'Account Source' field is only a reference to the Standard value set.

Resolution:

To resolve this issue try running a comparison that includes the Standard value set, Global value set and Custom object metadata types in a custom filter. You can then filter the Gearset result and find the changes you're interested in.

Is your CI job failing with this error?

Based on our customers' use cases, we have observed this validation error is more likely to occur when your CI job run is configured to be a Delta CI.

It may happen that the metadata filter for your Delta CI run doesn't include all the required metadata types, such as Standard value set, Global value set and Custom object, for the validation to succeed. This is usually due to the way Delta CI is designed to work - you can read more about Delta CI in this support article.

Resolution for that is to consider deploying your changes via standard 'Compare and deploy' feature. This is because you cannot amend your CI job setting for the job not to work as a Delta CI (effectively making it work as any other standard CI job).

Another possible cause:
We have also seen this validation error surfacing during the CI job validation where, in a specific user case, the issue was that some picklist values were changed directly in a Salesforce org (the org that's the target of the CI job), but those values weren't amended in the repository (in the environment branch, the source of the CI job).

In this case even though you may be branching from the Master/Main branch when promoting changes, thinking it's your source of truth, but it isn't, and therefore you may face validation issues.

The resolution would be to sync the changes made directly in the Salesforce org (CI target) with the environment branch (CI source) before promoting new changes to this environment via PR within Pipelines.

This validation error may also linked to another error we've documented:
Control field value <xxx> not found, valid values are <yyy>

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.

Did this answer your question?