Change Matching Rule
Detection
- RegExp:
Error (.*) Before you change a matching rule, you must deactivate it
Examples
Error Account.Standard_Account_Match_Rule Before you change a matching rule, you must deactivate it
Resolution
Salesforce refuses to change matching rule {1} while it is active.
- Deactivate {1} in the target org before the deployment: the deployment activates it again if its file says so
- The manual deployment action below reminds to do it in each org of the pipeline, with a checkbox in the Pull Request comments
Deployment action
A deployment action can solve this error. Create it on the Pull Request of the current branch:
sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type manual --label "Deactivate matching rule {1}" --instructions "1. Open Setup, type Matching Rules in the Quick Find box, and open Matching Rules
2. Click Deactivate next to {1}, and wait until its status is Inactive
3. If it is already inactive, there is nothing to do"
Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/