Salesforce Certified Platform App Builder — Question 350
An app builder is creating a custom object called Testimonial__c and wants to connect Testimonial__c records with both the submitter’s Contact record and Account record. If the Account is deleted, the Testimonial__c should also be deleted. If the Contact is deleted, but the Account remains, the Testimonial__c should remain.
How should this be accomplished?
Answer options
- A. Create a lookup relationship from Testimonial__c to Account and a master-detail relationship from Testimonial__c to Contact.
- B. Create a master-detail relationship from Testimonial__c to Account and a lookup relationship from Testimonial__c to Contact.
- C. Make Testimonial_c a junction object between Account and Contact using master-detail relationships.
- D. Make both the Contact and Account fields required on the Testimonial__c object and create lookup relationships from Testimonial__c to Contact and to Account.
Correct answer: B
Explanation
The correct answer is B because a master-detail relationship from Testimonial__c to Account ensures that if the Account is deleted, the associated Testimonial__c records are also deleted. The lookup relationship from Testimonial__c to Contact allows the Testimonial__c records to remain even if the Contact is deleted, as long as the Account remains intact. The other options do not meet both requirements effectively.