Skip to main content

#DML Statements0 debatiendo

Hi all,

Since USER_MODE is out of beta in Spring 23, I am looking forward to change all of my FLS and object permissions checks with USER_MODE access level for all my database operations.

My question is, as an ISV, will security review accept this check? or is there something else I still need to take care of?

 

Thanks

#Security #Apex #FLS #Object Permissions #DML Statements

5 respuestas
  1. 7 feb 2023, 20:41

    Yes, User Mode was built with ISV security review as a first order priority. You can replace all manual CRUD/FLS checks with the new USER_MODE. 

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