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
Shetal MehtaShetal Mehta 

salesforce lightning application for compare lead and contact

Purpose of this application is find duplicate records,

I have arround 60K records for contact and 60K records for lead.

I tried to SOSL/SOQL query join between contact and lead but its not possible as there is no any link between contact-lead object.

In SOSL able to get all records but there is issue fot get all records into one query because SOSL has 2000 max limit.

Appericiate for any sample code or any ideas!!!
Thanks in Advance!
 
Gopal ChoudharyGopal Choudhary
Hi,

Greetings to you!

You could do a SOQL query on your closed Leads. The following query will provide you a list of all Accounts and Contacts that originated from a converted Lead. You could filter it on specific Account Ids, if necessary.
Get all converted Accounts and Contacts:
 
1
SELECT Id, ConvertedAccountId, ConvertedContactId FROM Lead WHERE Status = 'Qualified'


To find the original Lead for a specific Contact, use below query:
 
SELECT Id FROM Lead WHERE ConvertedContactId = 'Enter_Contact_Id'


I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Gopal choudhary
Shetal MehtaShetal Mehta
Hello Gopal,

Thanks for your answer!!

I am not asking about converted lead, don't know why you are answering for the same!!!

My question is am I able to join Lead and Contact (not account and contact).
Or is there any way to get list of all Lead and Contact into the loop.
Suppose have 60K records, then get 10K records in one time and loop it to 6 times so, get all records into one list object.

Hope its more clear
Thanks,