function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Richard TsaiRichard Tsai 

MasterRecordId not set for merged Contacts

Hello,

Does anyone know why the MasterRecordId for a Contact would not be set after it has been merged?
When I merge Contacts and run this query:
SELECT Id, Name, MasterRecordId, MasterRecord.Name
FROM Account
WHERE isDeleted=true and MasterRecordId != null

nothing is returned
kevin lamkevin lam
You need to add the ALL ROWS keywords to query deleted records:

SELECT Id, Name, MasterRecordId, MasterRecord.Name
FROM Account
WHERE isDeleted=true and MasterRecordId != null ALL ROWS
Richard TsaiRichard Tsai
Kevin,

Thanks for that info.