+ Start a Discussion

Too many DML rows



We had a problem with an Apex trigger that has now hopefully been fixed. However, it seems like some kind of buffer has filled up and now it is trying to bulk update all the records that it couldn't when the error was being thrown. This is causing a Too Many DML rows exception...


Does anyone know how this memory of updates to be performed can be cleared? Or is my thinking completely wrong...?






I don't think it is a problem with buffer.

There can be 2 things:-

1. Your trigger is doing a circular or recursive update:- which arises due to faulty design or incorrect code, there should be an escape route from update so that repeated updates are prevented.

2. Second thing is that the trigger logic is actually bringing in too many rows for update.

The changes of the first option is more likely. Also during updates trigger should be handled to tackle salesforce limits of
DML updates and SOQL queries with appropriate.


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.