Refer to the code snippet below:As part of an integration development effort, a developer is tasked to create an Apex method that solely relies on the use of foreign identifiers in order to relate new contact records to existing Accounts in Salesforce. The account object contains a field marked as an external ID, the API Name of this field is Legacy_Id_c. What is the most efficient way to instantiate the parentAccount variable on line 02 to ensure the newly created contact is properly related to the Account? A. Account parentAccount = new Account(Legacy_Id_c = externalIdentifier); B. Account parentAccount = [SELECT Id FROM Account WHERE Legacy_Id_c = :externalIdentifier].Id; C. Account parentAccount = [SELECT Id FROM Account WHERE Legacy_Id_c = :externalIdentifier]; D. Account parentAccount = new Account();parentAccount.Id = externalIdentifier; Â Suggested Answer: A Community Answer: A This question is in Certified Platform Developer II Exam For getting Salesforce Certified Platform Developer II Disclaimers: The website is not related to, affiliated with, endorsed or authorized by Salesforce. Trademarks, certification & product names are used for reference only and belong to Salesforce. The website does not contain actual questions and answers from Salesforce's Certification Exams.
Please login or Register to submit your answer