FIELD_FILTER_VALIDATION_EXCEPTION in Salesforce: what it means and how to fix it

Short answer: FIELD_FILTER_VALIDATION_EXCEPTION means a lookup or master-detail field has a required lookup filter, and the record you referenced doesn't satisfy it. The ID can be perfectly valid; the related record just has the wrong values for the filter, such as an inactive user or an Account of the wrong type.

A lookup filter is a set of criteria an admin attaches to a lookup or master-detail field. It restricts which records the field may point at, for example "Account Type must be Customer" or "User must be active". When the filter is required, Salesforce checks it on every save, and a reference that fails the check is rejected:

FIELD_FILTER_VALIDATION_EXCEPTION: Value does not exist or does not match filter criteria.: [AccountId]

The wording is the default message for a required filter, and admins can rewrite it. The bracketed name is the lookup field whose filter failed.

Why it happens

  • The parent has the wrong field values. The filter compares fields on the referenced record. An Opportunity pointing at an Account whose Type is Prospect, when the filter demands Customer, fails even though the Account exists.
  • Filters that compare both records. Criteria can reference the record being saved too, such as "Contact's Account must match this Case's Account". Loading one side without the matching value on the other trips the filter.
  • Inactive or restricted users. Filters on user lookups commonly require IsActive = true or a particular profile or role. Owners and approvers copied from older data are frequent offenders.
  • Load order. If the parent was inserted first and the field the filter relies on is filled in later by an update or automation, the child fails in the meantime.
  • Different filters per org. A sandbox can carry a filter that production doesn't have, or one with tighter criteria.

How to fix it

  1. Read the filter. In Object Manager, open the field named in the error and review its lookup filter criteria and whether it's required.
  2. Query the referenced record. Check the parent's values against the criteria, for example SELECT Type FROM Account WHERE Id = '001...'.
  3. Fix the parent or the reference. Update the parent so it qualifies, or point the lookup at a record that does.
  4. Load the qualifying values first. Make sure the fields the filter depends on are populated on the parent before the children arrive.
  5. Exempt the integration user. Filter criteria can include conditions on the running user's profile or role, so the filter can let the load user through while still applying to everyone else.
  6. Deactivate briefly in a sandbox. For a one-off load, turn the filter off and turn it back on as soon as the load finishes.

How Syntharil handles it

Syntharil classifies this as a schema or configuration error: the fix lives in the target org's filter setup or in which parent a record points at, not in regenerating values. When seeding, it fills a lookup with the ID of a parent created earlier in the same job, chosen at random, and it doesn't evaluate lookup filter criteria while choosing. A required filter can therefore reject some generated children. During replication, lookups are rewritten to the parent's new ID in the target, or cleared when the parent isn't part of the copy, and the target's lookup filters are left as they are. Rejected rows are reported with Salesforce's message, so the field and filter are easy to trace.

FAQ

Which field caused FIELD_FILTER_VALIDATION_EXCEPTION?

The API names the lookup field after the message, usually in brackets. Open that field in Object Manager and look at its Lookup Filter section to see the criteria the referenced record has to meet.

Do optional lookup filters cause FIELD_FILTER_VALIDATION_EXCEPTION?

Optional lookup filters only narrow what users see in the lookup search dialog, and users can still pick other values. Required filters are the ones enforced when the record is saved, so they are the ones that reject API loads.

Can I change the lookup filter error message?

Yes. When you edit a required lookup filter you can replace the default text with your own message. If your error text doesn't read as the default, someone customized it on that field.

How is a lookup filter different from a validation rule?

A validation rule checks the record being saved. A lookup filter checks the record the lookup points at, and can compare it with fields on the record being saved. Deactivating validation rules does nothing to lookup filters.

Can a lookup filter be switched off without deleting it?

Yes. A lookup filter has an active setting, so an admin can deactivate it during a sandbox load and reactivate it afterwards without rebuilding the criteria.

All Salesforce errors →

Try Syntharil free