• sophia joseph
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I have a requirment to generate a report for the duplicated leads in our system with the same lead's email address and the one of the lead source in the duplicaed equal "Option1" and the lead source in the other  duplicated leads equal "Option2" . I used the following SOQL query : 

SELECT Count(Id), Email FROM Lead where  LeadSource IN ('Option1','Option2') GROUP BY Email HAVING Count(Id) > 1

I got all the duplicated leads , but my requirment is getting the duplicated  for both options "Option1" and "Option2". we don't need to get the duplicated where the source is equal Option1 or Option2 in both duplicated leads. 

 Is that possible with SOQL or i need Apex code. Please help. 

Thanks.