Skip to main content

Regarding the topic of DMLs and governor limits, scenario 1 (Database.update within for-loop) is bad because you may run into the limit of 150 DML statements.  Scenario 2 (Database.update after single for-loop) is bad, I think, because you may run into the 10,000 DML rows limit.

 

The recommended scenario 3 has two for-loops and a Database.update after the inner for-loop. Since the number of allowed DML statements per transaction is 150 and the for-loop chunks up the returned data into batches of 200, does this mean the theoretical limit then is 30,000 rows (150 x 200)?

 

So if more than 30,000 query rows were to be returned (and less than 50,000), would a batch process need to be called? @Andres Perez (ELTORO.it) @ELTOROIT Friends 

3 comentarios
0/9000