How to fix FIELD_INTEGRITY_EXCEPTION in Salesforce deployments
A value being saved does not match what the field expects, most often a picklist value that does not exist in the target org.
Surfaces during: runtime DML, most often Apex test execution or a data loadWhat it means
FIELD_INTEGRITY_EXCEPTION means a value failed the platform's own integrity check for a field, commonly a picklist value that is not defined in the target org, or a value that violates a restricted picklist or a type constraint. Picklist values are org-specific metadata, so they have to be deployed and kept in sync just like any other component.
The Metadata API deploys standard-object picklist value changes as part of the object's metadata, so a mismatch here almost always traces back to a picklist value edit that reached one org's Setup but never made it into version control or a matching deployment.
Common causes
The fix
- Deploy the picklist values firstInclude the global value set or field-level picklist value change in the same deployment as anything that uses it.
<valueSet> <valueSetDefinition> <sorted>false</sorted> <value><fullName>Renewal_Pending</fullName><default>false</default></value> </valueSetDefinition> </valueSet> - Keep restricted picklists in syncAudit restricted picklist values across environments so source and target orgs allow the same set.
- Update dependent test dataAfter a field type change, update any Apex test data or formula fields that assumed the old type.
How Serpent prevents this
Serpent AI's environment diff shows exactly which picklist values exist in one org and not the other, before a deployment ever runs. See the Salesforce deployment error library.

Prevention
Related errors
FIELD_INTEGRITY_EXCEPTION, answered
Start free. No credit card, no install, no commitment.
Set up in under 15 minutes. No DevOps hire needed.
