You need to sign in to do that
Don't have an account?
SBN
Lead Conversion to the Exisitng Contacts
Hi ,
I have a trigger on a Contact object which converts the Leads( If exists) by matching the Email id to a contact if a new contact is inserted into the Contact Object.
The issue is, some of the Leads in the database doesn't have the email id so the trigger didnt convert lead to contact instead created a new contact. For future records I can change the code to match by Phone Number or Name but for the exisitng Leads and contacts, What would be the best procedure to convert the exisitng leads to the exisiting contacts by matching the Phone Number/Name.
Thanks
I have a trigger on a Contact object which converts the Leads( If exists) by matching the Email id to a contact if a new contact is inserted into the Contact Object.
The issue is, some of the Leads in the database doesn't have the email id so the trigger didnt convert lead to contact instead created a new contact. For future records I can change the code to match by Phone Number or Name but for the exisitng Leads and contacts, What would be the best procedure to convert the exisitng leads to the exisiting contacts by matching the Phone Number/Name.
Thanks
leadconvert.setcontactid('ID');
source: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_Database_LeadConvert_instance_methods.htm
Does that help or am I not following the questions?
See the link below - which explains with example how to avoid duplicate leads on conversion:
http://www.salesforce.com/docs/developer/cookbook/Content/apex_dedupe.htm
Also read below,
http://starrforce.com/2011/01/best-salesforce-practice-of-the-week-have-happy-data-avoid-creating-duplicate-records-from-leads/
There is also a trigger below,
http://salesforce.stackexchange.com/questions/14604/lead-convert-to-avoid-duplicate-values-to-contact
Regards,
Ashish
But as I said I need to convert the exisiting leads in the lead object to the exisiting contacts in the contact object by matching the phone number or name . Please let me know the best procedure for it.
Thanks
While creating a Lead - usually manually done if a contact exists then an opportunity is created but not a Lead - that is a procedural flow.
If doing from an API etc you can use the Code in the below thread which will validate and then only Insert.
http://salesforce.stackexchange.com/questions/10151/apex-trigger-update-lead-if-contact-with-same-email-already-exists
Regards,
Ashish
Thank for the reply. I will try with this and will let you know if this is working or not