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
Sujan Kumar ReddySujan Kumar Reddy 

Interview question: Awaiting replies from experts

Hi,

 

Interview Question: Awaiting replies from experts

 

Will the following snippet work ?

 

public class insst1
{

public void sav()

{

for(integer i=0;i<250;i++)
{
Lead c=new lead();
c.FirstName='Mr'+i;
c.company='XYZ';
insert c;
}

}
}

 

 

Best Answer chosen by Admin (Salesforce Developers) 
MagulanDuraipandianMagulanDuraipandian

No.

The reasons are

Total number of DML statements issued - 150

LastName is a mandatory field.

 

Regards,

Magulan D

Salesforce.com certified Force.com Developer.

SFDC Blog

If this post is your solution, kindly mark this as the solution.