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
bryanobryano 

Querying for Merged Leads

So I merged 3 lead records through Salesforce.

When I use the following soql to extract leads:
Select IsDeleted, Name, Id, MasterRecordId from Lead

I see 2 records where the IsDeleted is 1 and MasterRecordId is NULL, and I see 1 record where the IsDeleted is 1 and the MasterRecordId has a salesforce id in it, which is what I would expect from running the query above.

However, if I run the following soql:
Select LeadId, CampaignId, IsDeleted, Lead.IsDeleted, Lead.Name, Lead.Id, Lead.MasterRecordId, Id from CampaignMember

I only get back 2 records where the IsDeleted is 1 and the MasterRecordId is NULL. I'm not getting back the record where the MasterRecordId has a salesforce id in it.

Can someone explain why that would be?

Thanks.