A healthcare company uses Salesforce to manage patient care. The administrator is designing a custom data model to link a custom object named Medical_Procedure__c to both Patient__c and Doctor__c. The architecture must satisfy two specific constraints:
1. The Patient__c record must display a native Roll-Up Summary field calculating the sum of procedure costs from all related Medical_Procedure__c records.
2. If a Doctor__c record is deleted from the system, any associated Medical_Procedure__c records must remain active, and the reference to the deleted doctor must simply be cleared.
Which relationship configuration must the administrator implement on the Medical_Procedure__c object to meet these requirements?
- Create a Master-Detail relationship pointing to Patient__c, and create a Lookup relationship pointing to Doctor__c configured to clear the value of the field if deleted.Answer
- BCreate Master-Detail relationships pointing to both Patient__c and Doctor__c, enabling the 'Allow reparenting' option on the Doctor__c relationship.
- CCreate Lookup relationships pointing to both Patient__c and Doctor__c, setting the Organization-Wide Defaults of Medical_Procedure__c to Controlled by Parent.
- DCreate a Master-Detail relationship pointing to Doctor__c, and create a Lookup relationship pointing to Patient__c.
Answer
Create a Master-Detail relationship from Medical_Procedure__c to Patient__c, and a Lookup relationship from Medical_Procedure__c to Doctor__c configured to clear the field value upon record deletion.
To calculate roll-up summary values natively on Patient__c, Patient__c must be the master object in a Master-Detail relationship with Medical_Procedure__c. To prevent Medical_Procedure__c records from being deleted when a Doctor__c record is removed, the link to Doctor__c must be a Lookup relationship set to clear the field value upon deletion.
Step-by-Step Solution
Key Concept
Object Relationship Design (Master-Detail vs. Lookup Behavior)
Estimated Time:2m 0s