Question

Difficulty: MediumObject Relationships (Lookup, Master-Detail, Many-to-Many)

An administrator at a renewable energy company needs to summarize total maintenance costs on the custom object Equipment__c by aggregating costs from related Maintenance_Log__c records. The administrator attempts to create a Roll-up Summary field on Equipment__c, but the Roll-up Summary field type option is disabled. Upon reviewing the schema, the administrator notices that Maintenance_Log__c currently links to Equipment__c through a Lookup relationship. Which action should the administrator take to meet the business requirement?

  1. Ensure all Maintenance_Log__c records have an assigned Equipment__c value, convert the Lookup relationship on Maintenance_Log__c to a Master-Detail relationship, and then create the Roll-up Summary field on Equipment__c.Answer
  2. B
    Create the Roll-up Summary field directly on the Maintenance_Log__c child object and reference the Equipment__c Lookup field within the calculation criteria.
  3. C
    Delete all Equipment__c records that lack child Maintenance_Log__c records, as orphan parent records prevent Roll-up Summary fields from being enabled on Lookup relationships.
  4. D
    Create a standard Formula field on Equipment__c using the SUM() function to iterate over related Maintenance_Log__c records across the Lookup relationship.

Answer

Ensure all Maintenance_Log__c records have an assigned Equipment__c value, convert the Lookup relationship on Maintenance_Log__c to a Master-Detail relationship, and then create the Roll-up Summary field on Equipment__c.
Roll-up Summary fields are exclusive to Master-Detail relationships and are created on the master object to aggregate values from detail records. To enable this field type, the administrator must convert the Lookup field on the child object to a Master-Detail field. A Lookup relationship can only be converted to Master-Detail if every existing child record contains a value in the lookup field.

Step-by-Step Solution

1
Identify why the Roll-up Summary field option is disabled on Equipment__c.
Roll-up Summary fields require a Master-Detail relationship between the parent (master) object and the child (detail) object.
Salesforce standard functionality prohibits Roll-up Summary fields on Lookup relationships.
2
Prepare the child records for relationship conversion.
Populate the Equipment__c field on all existing Maintenance_Log__c records.
Converting a Lookup field to a Master-Detail relationship requires every child record to have a valid parent reference.
3
Convert the relationship and create the summary field.
Change the field type on Maintenance_Log__c to Master-Detail, then build the Roll-up Summary field on Equipment__c.
This unlocks the Roll-up Summary field creation on Equipment__c to aggregate maintenance costs.

Key Concept

Roll-up Summary fields can only be created on the master object in a Master-Detail relationship, and converting a Lookup field to Master-Detail requires populating all lookup values first.
Rate this question