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
Neha Sharma 342Neha Sharma 342 

Line: 3, Column: 10 Method does not exist or incorrect signature: void createtNewLeadRecord() from the type LeadHelpe


classs 


public class LeadHelper 
{
 public void createNewLeadRecord()
 {
     Lead ld = new Lead ();
     ld.FirstName = 'Test';
     ld.LastName ='Lead record';
     ld.Company = 'google';
     ld.Status = 'OPen - Not contacted';
     ld.Rating = 'HOt';
     ld.Industry = 'Banking';
     ld.AnnualRevenue = 4500000;
     ld.Phone = '6765434567';
     ld.Fax = '6776543456789';
     ld.Email = 'sample@gmail.com';
     ld.LeadSource ='web';
     ld.website = 'www.salesforce.com';
     ld.city = 'Hyderabad';
     ld.Country = 'india';
      
     insert ld;
     if(ld.id != null)
         system.debug('lead record inserted with id .....:'+ld.id);
     
         }
     
 
}


execution


LeadHelper ldHelper = new LeadHelper();

ldHelper.createtNewLeadRecord();



 
Maharajan CMaharajan C
HI Neha,

There is a typo error in below line: (am seeing the extra t )
ldHelper.createtNewLeadRecord();  ==>  ldHelper.createNewLeadRecord();

Execute the below code :
LeadHelper ldHelper = new LeadHelper();
ldHelper.createNewLeadRecord();

Thanks,
Maharajan.C

 
Suraj Tripathi 47Suraj Tripathi 47

Hi,

there is no need to make the object of class LeadHelper 

just call the method as the below

LeadHelper.createNewLeadRecord();

or

LeadHelper ldHelper = new LeadHelper();
ldHelper.createNewLeadRecord();
 

Please mark it as the Best Answer if it helps you

ravi soniravi soni
hy Neha,
you did simply mistake to adding extry t in this ldHelper.createtNewLeadRecord();

try below code.
LeadHelper ldHelper = new LeadHelper();
 ldHelper.createNewLeadRecord();
let me know if it helps you and don't forget to mark it as best answer.
Thank you