Salesforce Certified Platform Developer II — Question 260
A company accepts orders for customers in their enterprise resource planning (ERP) system that must be integrated into Salesforce as Order__c records with a lookup field to Account. The Account object has an external ID field, ERP_Customer_ID__c.
What should the integration use to create new Order__c records that will automatically be related to the correct Account?
Answer options
- A. Insert on the Order__c object followed by an update on the Order__c object.
- B. Merge on the Order__c object and specify the ERP_Customer_ID__c for the Account relationship.
- C. Upsert on the Order__c object and specify the ERP_Customer_ID__c for the Account relationship.
- D. Upsert on the Account and specify the ERP_Customer_ID__c for the relationship.
Correct answer: C
Explanation
The correct answer is C because using Upsert on the Order__c object allows for both the creation of new records and the linking to the correct Account using the external ID ERP_Customer_ID__c. Option A requires two operations, which is inefficient, while B is incorrect because merge operations do not apply in this context. Option D would not create Order__c records directly and is therefore not suitable for the requirement.