We just activated Salesforce's native duplicate management on an existing org. The users are still in classic, so in order to make it really noticeable that there is a duplicate, I'm creating a vf page to embed in the contact detail which will have a list of the duplicates, very similar to how it looks in lightning.
To do so I'm running the following queries in a custom controller:
Call the following code, where
contactid
is the id of the contact taken from the get parameters:thisDuplicateRecordItem = [SELECT Id, DuplicateRecordSetId FROM DuplicateRecordItem WHERE RecordId = :contactId LIMIT 1]; thisDupRecSetId = thisDuplicateRecordItem.DuplicateRecordSetId;
Run the following query:
SELECT RecordId FROM DuplicateRecordItem WHERE DuplicateRecordSetId = :thisDupRecSetId
I would assume that this would give me the same number of results as I get on the page in lightning. I'm developing this in my sandbox which is in lightning for now, and see different results.
I have three contacts that show up as duplicates on each other's pages, but when I enter one of the contact's id in the get param, it doesn't pull any duplicates, and when I enter either of the others, it pulls one.
Why would that be?