You need to sign in to do that
Don't have an account?
karthik Jonnalagadda
How to write a Test class to insert a record into Lead object
Hi all,
Any one can please give a sample code (Insert class and Test class ) from insert and update record into Lead Object.
Thanks in advance
Any one can please give a sample code (Insert class and Test class ) from insert and update record into Lead Object.
Thanks in advance
Here is the sample code for insert lead records and updating the same.
List<Lead> lstLead = new List<Lead>{
new Lead(Company = 'JohnMiller', LastName = 'Mike', Status = 'Open'),
new Lead(Company = 'Nike', LastName = 'John', Status = 'Open'),
new Lead(Company = 'Miles', LastName = 'Davis', Status = 'Open'),
new Lead(Company = 'Reebok', LastName = 'Hillen', Status = 'Open'),
new Lead(Company = 'Addidas', LastName = 'Shrin', Status = 'Open')
};
insert lstLead;
lstLead[0].LastName = 'MikeMuller';
update lstLead;
Please let us know if it helps.
Thanks
Sunil
Use the following code
I am geeting score 0%.
code :
Just for confirmation you are using the VF page right ?
Can yoou please use this code
No I am not using VF page Just APex class
Invalid type: CreateNewLead.CreateLead