Skip to main content

#DML Statements토론 중인 항목 0개

더 빠른 답변과 실시간 도움을 받으려면 Slack에서 논의하세요.
Ori Fishman 님이 User-Mode Database Operations에 질문했습니다

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개
  1. 2023년 2월 7일 오후 8: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. 

Scenario: We are running an Apex block with Database.Insert and the number of DML statements hit the governor limit. In this case, would the first 100 records get saved or the entire transaction would fail?

댓글 5개

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개