Question

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

An administrator at Cloud Kicks needs to track maintenance history on custom machinery. Currently, a custom child object named Maintenance_Log__c connects to a custom parent object named Machine__c via a standard Lookup relationship. The business analyst specifies two new requirements: first, the Machine__c record must automatically display the total cost of all related maintenance logs using a declarative aggregate field; second, deleting a Machine__c record must automatically remove all of its associated Maintenance_Log__c records. When attempting to create the aggregate field on Machine__c, the administrator notices that the Roll-Up Summary field type is unavailable. Which action must the administrator take to satisfy both business requirements?

  1. Ensure every existing Maintenance_Log__c record has a populated Machine__c lookup value, then convert the relationship field type on Maintenance_Log__c from Lookup to Master-Detail.Answer
  2. B
    Create a Roll-Up Summary field directly on the Machine__c object while maintaining the Lookup relationship, relying on schema refresh to enable the field type.
  3. C
    Modify the Lookup field configuration on Maintenance_Log__c to allow cascade deletion, then build a cross-object formula field on Machine__c using the aggregate SUM function.
  4. D
    Convert the Lookup field to a Master-Detail field directly on Maintenance_Log__c without auditing existing records, as Salesforce automatically populates null parent references.

Answer

Ensure every existing Maintenance_Log__c record has a populated Machine__c lookup value, then convert the relationship field type on Maintenance_Log__c from Lookup to Master-Detail.
To create a declarative Roll-Up Summary field on a parent object, a Master-Detail relationship must be present. Additionally, converting an existing Lookup relationship to a Master-Detail relationship requires that all existing child records contain populated parent lookup values. Once the field is converted to Master-Detail, cascading deletion of child records is automatically enforced upon master record deletion.

Step-by-Step Solution

1
Analyze the business requirements for data aggregation and deletion behavior.
Requirements call for a declarative Roll-Up Summary field on the parent object and automatic cascade deletion of child records when a parent is deleted.
Roll-Up Summary fields and cascading deletion are capabilities inherent strictly to Master-Detail relationships, not Lookup relationships.
2
Identify the prerequisite conditions for converting a Lookup relationship to a Master-Detail relationship.
All existing child records (Maintenance_Log__c) must have a non-null reference in the lookup field before conversion is permitted.
Master-Detail relationships enforce data integrity where child records cannot exist without a valid master parent.
3
Perform the relationship conversion and configure the Roll-Up Summary field.
Once converted to Master-Detail, the Roll-Up Summary field type becomes available on Machine__c, and deletion of a Machine__c record automatically cascades to related Maintenance_Log__c records.
This single configuration change fulfills both business requirements declaratively.

Key Concept

Master-Detail Relationship Capabilities and Conversion Requirements
Estimated Time:2m 0s
Rate this question