1

During a deploy from source control to an org, I get this error:

Contact.Standard_Rule_for_Contacts_with_Duplicate_Leads
Duplicate Rule The Phone field is invalid for this field mapping.

What would the reasons be for this to occur?

2

How I got into this state is another story ...

Here's why this can happen:

Your source control is out of sync with the deployment target org.

The specific reason in our org was:

  • Source control was populated from PROD. This included the default duplicate rule Contact.Standard_Rule_for_Contacts_with_Duplicate_Leads.
  • This default duplicate rule includes mapping of the OOTB Phone field on Contact.
  • Shield Platform deterministic encryption was (much later in time) enabled for the Contact.Phone field and deployed to PROD
  • Duplicate rules don't support probabilistic encryption fields in the Field Mapping. SFDC auto-disables these mappings upon detecting a probabilistically-encrypted field.
  • No one realized this (because the rule had never been activated) so source control's copy of the duplicate rule was never updated.
  • A subsequent deploy (e.g. a CI job) from source control of that duplicate rule to any Org that originated from PROD fails with the error The Phone field is invalid for this field mapping

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.