Salesforce Certified Platform Developer II — Question 141

A company represents their customers as Accounts that have an External ID field called Customer_Number__c. They have a custom Order (Order__c) object, with a Lookup to Account, to represent Orders that are placed in their external order management system (OMS). When an order is fulfilled in the OMS, a REST call to Salesforce should be made that creates an Order record in Salesforce and relates it to the proper Account.
What is the optimal way to implement this?

Answer options

Correct answer: B

Explanation

The correct answer is B because performing a REST PATCH with the Customer_Number__c allows for upserting the Order__c directly based on the external ID, ensuring it relates to the proper Account. The other options either require unnecessary additional steps, such as retrieving the Account ID or do not utilize the external ID effectively for the upsert operation.