I need to remove the standard duplicate rules before deploying all my metadata into my scratch org. I am deploying my own duplicate rules so now the standard ones are useless. For production and other regular sandboxes I removed the standard duplicate rules manually; however, for my scratch orgs I would like to automate this. Do you know how to remove this duplicate rules? I thought it would be possible via the sfdx commands but I did not find any relevant command.
Remove duplicate rules using sfdx
duplicate-managementsalesforcedx
Best Answer
Try the following bash script.
First, you need to list all duplicate rules, generate destructiveChanges.xml, then use sfdx force:mdapi:deploy command to remove them.
Create a file
test.sh
with this contentThen execute this file