You need to sign in to do that
Don't have an account?
Insert list of tasks having around 50000 records.
Hi Guys,
I have a scenario where I am collecting tasks in a list.
Now the size of this list can exceed 50000.
How can i insert this list containing task Records into database .
Since the maximum size of DML is 10000 using list,thats why Insert will fail if list size exceed 10k.
I also want to send an email to user once the Insert is succesfull.
Sample code
List<SMP_Step__c> SMPSteps=new List<SMP_Step__c>();
SMP_Step__c temp=new SMP_Step__c(name='AnkitTest',Step_Name__c='tasktestbatch',Step_Type__c='Task',SMP_Template__c='a0PU0000001eX12');
for(Integer i=1;i<=50000;i++)
{
SMPSteps.add(temp);
}
Now this List SMPSteps has 50000 records ,so how to proceed in this type of scenario.
Plz help.
Break it up into small chunks. You're allowed 150 DML statements.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm