You need to sign in to do that
Don't have an account?
Zaide Ostrozubi
Prevent a lead created via web to lead if contact (email) already exists
Hi - totally new to code here and need help. We are using web to leads for forms on our website. Often our clients that already exist will complete a form and then the web to lead form creates a new lead. I don't want this to happen. I want the system to check if the "lead" already exists in Salesforce and create a task for follow up instead of creating a new lead. How can I do this? I've exhausted the salesforce support and they referred me to this page to ask for help from this fine community.
Greetings!
We have an existing idea created for the same requirement to check for the duplicate leads and not to allow inserting the new lead with the same email address.
Idea:https://trailblazer.salesforce.com/ideaView?id=08730000000BpWE
However,you can merge the existing Lead/Contact with the newly created lead record to avoid duplicates.
Please use the sample code provided in the below thread:
https://salesforce.stackexchange.com/questions/293825/create-a-trigger-to-merge-leads-if-the-email-already-exists-on-a-lead
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri
You need to create a trigger to accomplish this task
I have created a trigger rough code for you , there may be typo mistake.
Hope this helps!
https://www.sfdc99.com/beginner-tutorials/#beginnerTrigger