An administrator at Universal Containers needs to track compliance audits. The company uses a custom object named Inspection_Site__c and a custom object named Audit_Report__c, which are currently connected by a Lookup relationship. Management introduces two new requirements:
1. Deleting an Inspection_Site__c record must automatically delete all associated Audit_Report__c records.
2. A field on Inspection_Site__c must continuously display the aggregate count of all related Audit_Report__c records.
When attempting to create a Roll-Up Summary field on Inspection_Site__c, the administrator discovers that the option is unavailable. Which sequence of actions should the administrator perform to satisfy these requirements?
- ACreate a Roll-Up Summary field directly on Inspection_Site__c using the existing Lookup relationship, and enable the Cascade Delete option in the Lookup field definition.
- Populate the Inspection_Site__c lookup field on all existing Audit_Report__c records, convert the Lookup relationship to a Master-Detail relationship, and create the Roll-Up Summary field on Inspection_Site__c.Answer
- CDelete the existing Lookup relationship field on Audit_Report__c, create a new Master-Detail relationship field without populating parent references, and build the Roll-Up Summary field on Inspection_Site__c.
- DChange the Organization-Wide Default sharing setting of Audit_Report__c to Controlled by Parent to automatically enable Roll-Up Summary fields on the parent Inspection_Site__c object.
Answer
Ensure all existing Audit_Report__c records have a value in the Inspection_Site__c lookup field, convert the existing Lookup relationship field to a Master-Detail relationship, and then create the Roll-Up Summary field on Inspection_Site__c.
To fulfill the requirements, the relationship must be converted to Master-Detail because Master-Detail relationships automatically delete detail records when the master record is deleted and enable the creation of Roll-Up Summary fields on the master object. A Lookup relationship can only be converted to a Master-Detail relationship if all existing child records have a value in the lookup field.
Step-by-Step Solution
Key Concept
Converting Lookup Relationships to Master-Detail Relationships and Roll-Up Summary Requirements