開発者は、各リードのタスク レコードを作成する、リード オブジェクトに新しい after insert トリガーを作成しました。 運用環境にデプロイした後、Salesforce にリード レコードをバッチで挿入する既存の外部統合で、タスク挿入ステートメントが原因でバッチ全体の失敗が報告されることがあります。これにより、外部システムの統合プロセスが停止し、手動で再起動する必要があります。 バッチ内の一部のレコードがタスク挿入ステートメントによって失敗した場合に統合を続行し、手動での再起動が不要になるようにするには、開発者はどのような変更を加える必要がありますか?
正解:D
Using Database.insert with allOrNone=false allows partial success in DML operations. Option D: Use the Database method with allOrNone set to false. Records that cause errors are not inserted. Successful records are committed. Prevents the entire batch from failing. Why Not Other Options: Option A: Deactivating the trigger is not practical. Option B: Removing the class from the profile may cause other issues. Option C: A try-catch block won't prevent the batch from failing. Reference: Database Methods: "Use the Database DML methods to specify whether or not to allow partial record processing." - Apex Developer Guide: Using the Database Class