+ Start a Discussion
raghavi SRraghavi SR 

Contact API name during lead conversion and status


When we convert lead we get to see Account,Contact and opportunity before final conversion. 

I have to check if the contact names are interchnaged during conversion(CONTACT FIRST NAME,CONTACT LAST NAME)

trigger LeadWarning on Lead (before update)
    for (Lead l:trigger.new)
        if (l.IsConverted && trigger.oldMap.get(l.Id).IsConverted == false && 
        trigger.oldMap.get(l.Id).CONTACT FIRST NAME==trigger.newMap.get(l.Id).CONTACT LAST NAME && 
        trigger.oldMap.get(l.Id).CONTACT LAST NAME==trigger.newMap.get(l.Id).CONTACT FIRST NAME)
                  Trigger.new[0].addError(' error msg ');

How to map the contact API names to lead.

You can make use of below link, to know the converted contact , account information and from contact you can check First Name vs Last Name

Thank You,
Rajesh Adiga P.