A Salesforce Administrator needs to configure a custom data model to track Customer Refunds on a custom object named Invoice__c. The business requirement states that every Refund__c record must strictly belong to an Invoice__c record, and if an Invoice__c is deleted, all associated Refund__c records must be automatically deleted. Furthermore, finance managers must be able to view the sum of all refund amounts directly on the Invoice__c detail page. Which configuration should the administrator implement to meet these requirements?
- Create a Master-Detail relationship field on Refund__c referencing Invoice__c, and create a Roll-Up Summary field on Invoice__c to aggregate the refund amounts.Answer
- BCreate a Lookup relationship field on Refund__c referencing Invoice__c, and create a Roll-Up Summary field on Invoice__c to aggregate the refund amounts.
- CCreate a Lookup relationship field on Refund__c referencing Invoice__c, and rely on standard lookup deletion behavior to remove related Refund__c records.
- DCreate a Master-Detail relationship field on Invoice__c referencing Refund__c, and create a Roll-Up Summary field on Refund__c to aggregate the total invoice values.
Answer
Create a Master-Detail relationship field on Refund__c referencing Invoice__c, and create a Roll-Up Summary field on Invoice__c to aggregate the refund amounts.
Defining a Master-Detail relationship field on the child object (Refund__c) referencing the parent (Invoice__c) ensures that deleting an Invoice__c automatically deletes all related Refund__c records. This relationship type also enables the administrator to build a declarative Roll-Up Summary field on Invoice__c to calculate the sum of refund amounts.
Step-by-Step Solution
Key Concept
Master-Detail relationships dictate record ownership, sharing, and cascade-deletion behavior, and are mandatory prerequisites for creating declarative Roll-Up Summary fields on parent records.