Soru

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

A Salesforce Administrator at a commercial real estate firm needs to model a relationship between a custom object named Property__c and another custom object named Inspection_Site__c. Business rules require that deleting a Property__c record must automatically delete all related Inspection_Site__c records. Additionally, executive management requires displaying the total count of completed inspections directly on the Property__c record page without using custom Apex code. Which configuration approach should the administrator implement?

  1. Create a Master-Detail relationship custom field on Inspection_Site__c referencing Property__c, and create a Roll-Up Summary field on Property__c.Cevap
  2. B
    Create a Lookup relationship custom field on Inspection_Site__c referencing Property__c, and create a Roll-Up Summary field on Property__c.
  3. C
    Create a Master-Detail relationship custom field on Property__c referencing Inspection_Site__c, and create a Formula field on Property__c.
  4. D
    Create a Lookup relationship custom field on Inspection_Site__c referencing Property__c with cascade delete enabled via the metadata API.

Cevap

Create a Master-Detail relationship field on the child object Inspection_Site__c referencing the parent Property__c, and create a Roll-Up Summary field on Property__c.
To satisfy both requirements declaratively, a Master-Detail relationship must be defined on the detail object (Inspection_Site__c) pointing to the master object (Property__c). Master-Detail relationships automatically enforce parent-to-child cascade deletion and allow the administrator to build Roll-Up Summary fields on the master object to count or aggregate detail records.

Adım Adım Çözüm

1
Analyze data model requirements for cascading deletion and aggregation.
Identified that child records must be deleted when parent is deleted, and parent requires aggregate calculations (COUNT).
Master-Detail relationships natively handle cascade deletion of detail records and allow Roll-Up Summary fields on the master object.
2
Determine parent and child object positioning for the Master-Detail field.
Property__c is the Master object, and Inspection_Site__c is the Detail object.
The custom Master-Detail field must always be created on the detail (child) object pointing to the master (parent) object.
3
Configure declarative rollup calculation.
Create a Roll-Up Summary field on Property__c using the COUNT aggregate function on Inspection_Site__c.
Roll-Up Summary fields provide real-time, declarative calculations of related detail records on master records.

Anahtar Kavram

Master-Detail Relationship Capabilities and Roll-Up Summary Fields
Tahmini Süre:1m 30s
Bu soruyu puanla