FIELD_CUSTOM_VALIDATION_EXCEPTION" salesforce error
Decodes Salesforce FIELD_CUSTOM_VALIDATION_EXCEPTION: a validation rule rejected the data. Shows how to find the exact rule from the message and fix the data or the rule. Use when a save fails with this error code. Not for duplicate rules or required-field errors.
TL;DR
A validation rule on the object evaluated to true and rejected your data; the message text usually quotes the rule's own error text. Match that text to the rule in Setup, check which fields it inspects, then fix the data or narrow the rule. Never blanket-disable the rule to unblock a load.
Error
[ {
"message" : "Close Date must be in the current fiscal year",
"errorCode" : "FIELD_CUSTOM_VALIDATION_EXCEPTION",
"fields" : [ "CloseDate" ]
} ]Steps
- Copy the exact message text from the error. Expected: you have the rule's custom error message verbatim.
- In Setup, go to Object Manager, pick the object, then Validation Rules, and search for that message text. Expected: you land on the single rule that fired.
- Read the rule formula and the fields array from the error to see which fields it checks. Expected: you know the condition, for example CloseDate before today.
- Fix the data URIs correct the offending field values in your load file or agent payload. Expected: the same record saves cleanly.
- If the data is legitimately correct (for example backfilling historical closes), ask the admin to scope the rule (exclude the integration user profile or add a bypass checkbox), not to delete it. Expected: loads pass while interactive users keep the guardrail.
When to use
- Any insert, update, or upsert fails with FIELDCUSTOMVALIDATION_EXCEPTION.
- An agent's write-back worked for months and started failing after a new rule was deployed.
- Data Loader shows row-level failures with custom message text.
When not to use
- "required field missing" errors (missing data, not a rule).
- Trigger errors (CANNOTINSERTUPDATEACTIVATEENTITY).
- The message is blank, which points at a flow or process builder fault instead.
Tool compatibility
- Salesforce REST, SOAP, and Bulk APIs; validation rules on standard and custom objects.
- Data Loader, ETL tools, and agent write-back jobs.
Variant phrasings
Validation rule blocking legitimate updates
Same error from the admin side; the fix is scoping the rule, not deleting it.
FIELDCUSTOMVALIDATION_EXCEPTION with empty fields array
The rule fires on a formula or cross-object reference; read the rule formula directly.
Why it happens
Validation rules run before triggers on every write. They cannot tell an agent bulk load from a human typo, so a rule written for interactive entry often rejects legitimate programmatic data shapes.
Edge cases
- Rules referencing related objects (account fields from opportunity) fail when the related record changes, not when your record changes.
- Date rules using TODAY() behave differently across timezones; an agent in UTC can trip a rule written for Pacific business hours.
- Deactivating a rule to unblock a load and forgetting to reactivate it is the classic incident; use a scoped bypass instead.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_N8ApIIKrQA6mduh6FoXyGw