Question

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

An administrator is designing a custom data model to track logistics operations between a parent custom object, Shipment_Route__c, and a child custom object, Delivery_Hub__c. The business requires aggregate reporting of completed hubs directly on the route record and demands that deleting a shipment route automatically purges all connected hubs. However, several existing Delivery_Hub__c records currently lack an assigned parent.

Which two steps must the administrator take to establish this data model successfully? (Choose 2 answers)

  1. Populate the parent reference field on all existing Delivery_Hub__c records before converting the relationship field to a Master-Detail type.Answer
  2. Create a Roll-Up Summary field on the Shipment_Route__c object to aggregate metrics from related Delivery_Hub__c records.Answer
  3. C
    Create a Roll-Up Summary field directly on the parent Shipment_Route__c object while maintaining a standard Lookup relationship.
  4. D
    Maintain the relationship as a Lookup and configure a deletion trigger, because detail records are retained independently when a Master-Detail parent is deleted.

Answer

The administrator must populate the parent reference on all existing child records prior to converting the relationship to Master-Detail, and create a Roll-Up Summary field on the parent object.
Establishing a Master-Detail relationship satisfies the cascading deletion requirement and enables Roll-Up Summary fields on the parent object. Because existing child records lack parent references, those fields must be populated on every record before converting a lookup relationship to Master-Detail.

Step-by-Step Solution

1
Analyze data model requirements for cascading deletion and aggregate metrics
Determined that a Master-Detail relationship is required to support both cascading record deletion and Roll-Up Summary fields on the parent object.
Lookup relationships do not support native Roll-Up Summary fields and do not automatically delete child records when a parent is deleted.
2
Address data integrity constraints for converting/creating Master-Detail relationships on existing records
Identified that all existing child records must have a populated parent lookup field before converting the field definition to Master-Detail.
Salesforce enforces mandatory parent references on detail records in a Master-Detail relationship.
3
Configure the aggregate metric requirement
Created a Roll-Up Summary field on the parent Shipment_Route__c object to aggregate data from child records.
Master-Detail relationships allow parent objects to display native Roll-Up Summary fields for child record calculations.

Key Concept

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