How to fix DEPENDENCY_EXISTS in Salesforce deployments
Salesforce won't delete a field, object, or picklist value because another component still references it.
Surfaces during: metadata deletion, via destructiveChanges.xml or SetupWhat it means
DEPENDENCY_EXISTS blocks the deletion of metadata, a custom field, object, record type, or picklist value, because something else in the org still points to it: a formula, a validation rule, a flow, a report, or a page layout. Salesforce protects data integrity by refusing to remove a component out from under its dependents.
It only fires when the metadata already lives in the target org and something is deleting it, whether through Setup, a destructiveChanges.xml deployment, or the Tooling API; it never appears on a plain additive deploy of new metadata.
Common causes
The fix
- Find every dependent with Salesforce's dependency checkUse the "Where is this used?" tool in Setup on the field or object to list every formula, flow, report, and layout that references it.
- Remove or update each dependency firstEdit or delete the referencing formula, flow, validation rule, or report so it no longer points at the component.
- Delete the component in a separate stepOnce no dependents remain, delete the field or object on its own, after the dependency cleanup has landed in the target org.
<!-- destructiveChangesPost.xml, deployed after the dependency cleanup lands --> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>Account.Legacy_Score__c</members> <name>CustomField</name> </types> <version>62.0</version> </Package>
How Serpent prevents this
Serpent runs a preflight dependency check before a deletion reaches a shared org, so a field that's still referenced surfaces as a blocked task instead of a failed production deploy. See the Salesforce deployment error library.

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