Question

Difficulty: Very hardFormula Fields and Roll-Up Summary Fields

An administrator at a professional services firm needs to display the aggregate total of billable hours from child Time_Entry__c records on the parent Consulting_Engagement__c object. The two custom objects are currently connected via a Lookup relationship. When attempting to create a Roll-Up Summary field on Consulting_Engagement__c, the administrator notices that the Roll-Up Summary field type is disabled in the setup wizard. Upon investigating the data, several existing Time_Entry__c records have a blank Consulting_Engagement__c lookup field. What sequence of actions must the administrator take to successfully create the Roll-Up Summary field on Consulting_Engagement__c?

  1. Populate the Consulting_Engagement__c lookup field on all existing child Time_Entry__c records, convert the relationship field on Time_Entry__c from Lookup to Master-Detail, and then create the Roll-Up Summary field on Consulting_Engagement__c.Answer
  2. B
    Create a cross-object formula field using the SUM() function directly on the Consulting_Engagement__c object while maintaining the existing Lookup relationship.
  3. C
    Convert the relationship on Time_Entry__c to Master-Detail immediately without populating blank lookup values, as Salesforce automatically populates blank parent fields upon conversion.
  4. D
    Delete the parent Consulting_Engagement__c records with unlinked children to bypass field validation and force automatic master-detail recalculation.

Answer

Populate the Consulting_Engagement__c lookup field on all existing child Time_Entry__c records, convert the relationship field on Time_Entry__c from Lookup to Master-Detail, and then create the Roll-Up Summary field on Consulting_Engagement__c.
The option stating that all existing child records must have their lookup field populated prior to converting the relationship from Lookup to Master-Detail correctly follows Salesforce architecture requirements. Roll-Up Summary fields are exclusively available on the master side of Master-Detail relationships. To convert an existing Lookup field to a Master-Detail field, every existing detail record must contain a populated reference to a master record.

Step-by-Step Solution

1
Identify why Roll-Up Summary field creation is disabled
Recognize that Roll-Up Summary fields can only be created on the master object in a Master-Detail relationship.
Lookup relationships do not natively support declarative Roll-Up Summary fields.
2
Prepare child records for relationship conversion
Ensure 100% of existing child Time_Entry__c records have a valid reference in the Consulting_Engagement__c lookup field.
Salesforce enforces data integrity by preventing conversion from Lookup to Master-Detail if orphan child records exist.
3
Convert relationship and build Roll-Up Summary
Convert the lookup field on Time_Entry__c to a Master-Detail relationship type, then create the Roll-Up Summary field on Consulting_Engagement__c using the SUM aggregate function.
Once converted, the parent object permits native declarative aggregation of child records.

Key Concept

Roll-Up Summary Relationship Requirements and Conversion Prerequisites
Rate this question