ある会社には、order Number__c という必須の一意の外部 ID フィールドを持つカスタム オブジェクト order __c があります。 外部 ID フィールドを使用して、Order __c レコードのリストに新しいレコードを挿入し、既存のレコードを更新するために必要な DML を実行するには、どのステートメントを使用する必要がありますか?
正解:D
* Why upsert? * The upsert statement inserts records that don't exist and updates existing records based on the external ID (Order Number__c in this case). * Salesforce automatically recognizes and uses the external ID field for matching. * Why Not Other Options? * A and B: merge is for merging records, not for upserting. * C: Adding the field name after upsert is unnecessary, as Salesforce detects the external ID automatically. * Upsert Documentation: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode /langCon_apex_dml_upsert.htm References: