Apex trigger to add dr. Salutation on lead record. - Salesforce

No comments
Handler class:



public class LeadsTriggerHandler {
public static void createLead(List<Lead> lstLead)
{
     for( Lead ldcreate: lstLead)
    {

       if( ldcreate.Is_Doctor__c == True)
       {
          ldcreate.Salutation = 'Dr.';
       }
   }
}
}

Trigger:


trigger LeadsTrigger on Lead (before insert , before update) {

     LeadsTriggerHandler.createLead(Trigger.new);

}

No comments :

Post a Comment