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
Vserv CapitalVserv Capital 

I am write LeadHelper calss for lead genrate by lead helper But i cant remove Error please Tell me

public class LeadHelper {
     public static void createContact(List<Lead> leadList){
        Id ContactRecordTypeId =  Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('New').getRecordTypeId();
        List<Contact> listAcc=new List<Contact>();
        for(Lead l : leadList){
            Contact acct = new Contact();
            acct.firstName = l.firstName;
             acct.LastName = l.lastname;
            acct.Email = l.Email;
            acct.MobilePhone = l.MobilePhone.Substring(2,l.MobilePhone.length());
            acct.RecordTypeId = ContactRecordTypeId;
            acct.Source__c = 'Facebook';
            acct.Project__c = l.Project__c;
            acct.BillingCity__c = l.City;
            acct.Ad_Name__c = l.Ad_Name__c;
            listAcc.add(acct);
        }
        system.debug('listAcc : ' + listAcc);
        insert listAcc;
    }
}
 
Karan KeharKaran Kehar
Hi,

Can you elaborate your issue? What is the error you see?