Soru

Zorluk: OrtaObject Relationships (Lookup, Master-Detail, Many-to-Many)

An administrator needs to enable roll-up summary fields on the custom object Project__c to aggregate financial metrics from a related child custom object, Project_Milestone__c. Currently, Project_Milestone__c has an existing Lookup relationship to Project__c with existing records in the organization. The administrator also needs to ensure that deleting a Project__c record automatically deletes all related Project_Milestone__c records. Which TWO actions must the administrator take to fulfill these requirements? (Choose 2 answers)

  1. Populate the Project__c lookup field on all existing Project_Milestone__c records.Cevap
  2. Change the relationship field type on Project_Milestone__c from Lookup to Master-Detail.Cevap
  3. C
    Create roll-up summary fields directly on Project__c while maintaining the Lookup relationship.
  4. D
    Build a custom Apex trigger to delete child records because Master-Detail relationships do not support cascading deletion.

Cevap

The administrator must populate the lookup field on all existing child records and then convert the relationship field type from Lookup to Master-Detail.
To create roll-up summary fields and inherit cascading delete behavior, the relationship must be converted from Lookup to Master-Detail. Salesforce requires all existing child records to have a populated parent lookup field before this conversion can take place.

Adım Adım Çözüm

1
Verify and populate existing child record lookup fields
All child records have a valid parent reference
Master-Detail relationship fields are required on all child records, so any existing null lookup fields will prevent relationship conversion.
2
Convert the relationship field type from Lookup to Master-Detail
The relationship is converted to Master-Detail
This relationship type natively enables roll-up summary fields on the parent object and enforces cascading record deletion.

Anahtar Kavram

Converting Lookup to Master-Detail relationships and prerequisites for roll-up summary functionality
Bu soruyu puanla