+ 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.