+ Start a Discussion
Amish RanjitAmish Ranjit 

Exception:Too many DML rows: 10001 for batch class

I have use batch class to perform DML operation but I got a an email saying I have " System.LimitException :Too many DML rows: 10001". I try to solve this issue but could not figure out. Would be glad if anyone could help me out with this issue.
santanu boralsantanu boral
Your transaction can perform DML operation for atmost 10000 records.
Are you using any trigger or apex classes which are not bulkified?
VENKATA RANGAVENKATA RANGA
There is a limit on database operations imposed by salesforce. Here is the link that summaries these limits. Make sure that you code follows this.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm 
Amish RanjitAmish Ranjit
Thank you for the responce...I am using the batch class. When i try to run the batch class, it is showing the error "Too many DML rows: 1000".  What do i have to modify on my batch class to perform DML operation for more than 10000 records.
santanu boralsantanu boral
Can you please mark the answer, if it resolved your purpose.
Amish RanjitAmish Ranjit
i already know the limitation for records, but i need help with my batch class which should be able to handle more than 10000 records.
 
Amish RanjitAmish Ranjit
Like how do i modify my batch class so it can process more than 10000 records
K_TK_T
Hi Amish,

There is no way you can make the batch class update more than 10,000 records. That is a governor limit, so there is nothing you can do within that same batch to process it. What you can do instead is create a batch job to update those records, in addition to the batch job you already have.