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
raghavi SRraghavi SR 

Contact API name during lead conversion and status

Hi,

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.
Rajesh3699Rajesh3699
Hello 

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
https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_lead.htm

Thank You,
Rajesh Adiga P.