フリー問題

Salesforce Certified Platform Developer のフリー問題 7 / 20 問目

問題文

A credit union loads a nightly member file of about 8,000 rows. A handful of rows always fail a validation rule. The operations team needs the good rows saved and a per-row report of what went wrong. Which approach delivers that?

選択肢

  1. Use the insert statement inside a try and catch block and log the message from the DmlException that comes back to the calling method each time.
  2. Call Database.insert with the second parameter left at its default and walk the returned SaveResult array, since the array is returned either way and can be read row by row.
  3. Call Database.insert with the second parameter set to false and walk the returned SaveResult array, reading isSuccess and getErrors for each row to build the report, so that the good rows are committed and each failed row carries its own errors.
  4. Split the file into 8,000 separate insert statements so that a failure affects only the row it belongs to, and collect the caught exceptions into a list that the operations team reads the next morning.

解答・解説を確認するには

正解と解説の確認、回答の記録には無料登録が必要です。登録すると演習モードでフリー問題に回答し、正誤と解説をその場で確認できます。