For users with Performance or Ultimate Edition, you can run Duplicate Jobs in Lightning Experience to place records that are duplicates before activation of the Duplicate Rules into
However, if you are like most customers on Enterprise or lesser editions, you need to do some work to coerce existing (i.e. last edited before the duplicate rules were activated):
What doesn't work
- You might think you could just "touch" using Data Loader legacy records by putting them through the Save process but not actually changing any fields. You hope that SFDC will run the records through the active Duplicate Rules/Matching Rules and auto-create the
DuplicateRecordSet for you.
- Nope - this does not work
What does work (but probably not useful in most cases)
- Let's say you have a DuplicateRule/MatchingRule on
- If you used a script or Data Loader to change the emails from say
firstname.lastname@example.org then the
DuplicateRecordSet would be created. Of course, you would need to run the script again to change the values back from
email@example.com. Note that the toggling needs to be done in separate transactions.
- Except in some circumstances, the above is dangerous as you'd need to disable automation and triggers and not have any automation via Change Data Capture or the Marketing Cloud Connector or who knows what.
That is, Duplicate Rule logic executes only when the fields used in the Matching Rule(s) actually change on the save process.
What does work (but will be a pain)
- You need to identify the duplicates yourself using SOQL, reports+export+excel, or apex scripts
- Then, create
DuplicateRecordItems using most likely, Apex (but could also be done with Data Loader). Each
DuplicateRecordItem is a junction record between the
DuplicateRecordSet and the Sobject (
RecordId) that is a duplicate