Skip to main content
All CollectionsTroubleshootingSalesforce validation errors
Resolving validation errors - "Picklist value: <xxx> in picklist: <yyy> not found."
Resolving validation errors - "Picklist value: <xxx> in picklist: <yyy> not found."

Cause and resolution to this Salesforce validation error; including for when it happens on a CI job or PR validation

Quinn Kuiper avatar
Written by Quinn Kuiper
Updated over 6 months 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.

If you are seeing this error happen in a CI job, the resolution mentioned at the bottom of this article may be more relevant than the one below.

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.

This suggested resolution is in line with our documentation on picklist changes on standard fields.

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) or promotion branch (specifically for pipelines) depending on what changes you prefer to keep before promoting new changes to this environment via PR within Pipelines.

Note: If your environment branch (source of the CI job) is Main/Master, it is best to update the feature or promotion branch first to prevent risk of unintended changes in Production.

Possible workaround when the failure happens on a picklist value for a RecordType metadata

We've troubleshooted a use case where a solution to this error was to change the RecordType picklist value referenced in the error message to be a default value.

This is the error message investigated:
"Picklist value: %3F%3F A modifier in picklist: FRO_CV_c not found (line:192)"

The change can be done by replacing the XML of the failing component from (as highlighted in red on below screenshot):

<default>false</default> to <default>true</default>.

If the above solution doesn't work, we'd suggest to try to make other picklist values (highlighted above in blue) to be default values.

This advice is because sometimes Salesforce's error message may actually reference an incorrect picklist value as the component failing your validation!

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?