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
MadeForITMadeForIT 

an error unexpected token '=' is showing. Please help me find the issue.

Lead VarL1=new Lead();
VarL1.FirstName='Christina';
VarL1.LastName='Yang';
VarL1.company='Meditech';

Lead varL2 = new Lead();
varL2  =[select id,company from Lead MobilePhone ='9779379992'];
VarL2.company='Max';

list<Lead>VarLeadList=new list<Lead>();
VarLeadList.add(VarL1);
VarLeadList.add(VarL2);
update VarLeadList;
 
Suraj Tripathi 47Suraj Tripathi 47
Hi Aastha,

please try below code 
 
Lead VarL1=new Lead();
            VarL1.FirstName='Christina';
            VarL1.LastName='Yang';
            VarL1.company='Meditech';
            
            Lead varL2 = new Lead();
            varL2  = [select id,company from Lead where MobilePhone ='9779379992'];
            VarL2.company='Max';
            
            list<Lead>VarLeadList=new list<Lead>();
            VarLeadList.add(VarL1);
            VarLeadList.add(VarL2);
            update VarLeadList;

If you find your Solution then mark this as the best answer.

Thank you!

Regards,

Suraj Tripathi