A Salesforce Administrator needs to update an existing data model. Currently, a custom object named `Project_Task__c` references a custom object named `Project_Plan__c` using a Lookup relationship. The business requirements state that deleting a `Project_Plan__c` record must automatically delete all associated `Project_Task__c` records. In addition, the administrator must display the total estimated hours from all related tasks on the `Project_Plan__c` record using a standard Roll-Up Summary field. Which sequence of actions should the administrator perform to fulfill these requirements?
- Verify that all `Project_Task__c` records have a populated `Project_Plan__c` field, convert the Lookup relationship to a Master-Detail relationship on `Project_Task__c`, and then create a Roll-Up Summary field on `Project_Plan__c`.Answer
- BKeep the existing Lookup relationship on `Project_Task__c`, enable cascade delete on the lookup definition, and create a Roll-Up Summary field directly on `Project_Plan__c`.
- CCreate a new Master-Detail relationship field on `Project_Plan__c` that references `Project_Task__c` as the detail object, and then add a Roll-Up Summary field on `Project_Task__c`.
- DChange the Organization-Wide Default (OWD) sharing setting of `Project_Task__c` to Controlled by Parent and add a custom Formula field on `Project_Plan__c` to sum the hours.
Answer
Verify that all existing child records contain a value in the lookup field, convert the Lookup relationship on the child object to a Master-Detail relationship, and create the Roll-Up Summary field on the parent object.
To calculate aggregate values via native Roll-Up Summary fields and ensure automatic deletion of child records when a parent is deleted, a Master-Detail relationship is required. Before converting an existing Lookup relationship field to Master-Detail, every child record (`Project_Task__c`) must have a value in that lookup field. Once converted, Roll-Up Summary fields can be created on the master object (`Project_Plan__c`).
Step-by-Step Solution
Key Concept
Lookup to Master-Detail Relationship Conversion & Roll-Up Summary Prerequisites