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
PAWAN THOSARPAWAN THOSAR 

Write an apex Class, to Insert a Lead Record inside the Object.

Best Answer chosen by PAWAN THOSAR
SwethaSwetha (Salesforce Developers) 
HI Pawan,
You can try the below code snippet
public class InsertLead {
    public void insertleadmethod(){
        Lead ls= new Lead();
        ls.lastname='sample lead';
        ls.FirstName='first name';
        ls.Company='sample company';
        ls.Email='sample@gmail.com';
        insert ls;
    }
}

Run the below code from anonymous
InsertLead IL= new InsertLead();
IL.insertleadmethod();

If this information helps, please mark the answer as best. Thank you

All Answers

SwethaSwetha (Salesforce Developers) 
HI Pawan,
You can try the below code snippet
public class InsertLead {
    public void insertleadmethod(){
        Lead ls= new Lead();
        ls.lastname='sample lead';
        ls.FirstName='first name';
        ls.Company='sample company';
        ls.Email='sample@gmail.com';
        insert ls;
    }
}

Run the below code from anonymous
InsertLead IL= new InsertLead();
IL.insertleadmethod();

If this information helps, please mark the answer as best. Thank you
This was selected as the best answer
PAWAN THOSARPAWAN THOSAR
2. Write an apex program, to Insert 200 Hiring Manager Records inside the Object.
can u help this program 
SwethaSwetha (Salesforce Developers) 
HI Pawan, 
I see you posted this as another question that has been addressed https://developer.salesforce.com/forums/ForumsMain?id=9062I000000R5u0

Please consider marking the answer best to close the thread so it could help others too.

Thank you!