Salesforce Certified Platform Developer II — Question 25

Employee_c is a Child object of Company_c. The Company_c object has an external Id field Company_Id_c.
How can a developer insert an Employee_c record linked to Company_c with a Company_Id_c of '999'?

Answer options

Correct answer: D

Explanation

The correct answer is D because it correctly associates the Employee_c record with a Company_r object that uses the external ID Company_Id_c. Options A and B incorrectly attempt to assign a string directly to a reference field, while option C creates a new Company_c instance instead of referencing an existing one.