An administrator needs to establish a custom data model for a medical research organization to link Clinical Trials (Clinical_Trial__c) with Investigational Drugs (Investigational_Drug__c). A single trial can involve multiple drugs, and a single drug can be evaluated across multiple trials. If a Clinical Trial record is deleted, all records linking that trial to its associated drugs must be automatically removed. Furthermore, users must possess Read/Write access on the parent Clinical Trial record in order to create, edit, or delete the link records between a trial and a drug. How should the administrator configure the data model to meet these requirements?
- Create a custom junction object with Master-Detail relationships to both Clinical Trial and Investigational Drug, and set the Sharing Setting on the Clinical Trial master-detail field to Read/Write.Answer
- BCreate a custom junction object with Lookup relationships to both Clinical Trial and Investigational Drug, and configure a record-triggered flow to handle record deletion and security restrictions.
- CCreate a Lookup relationship from Investigational Drug to Clinical Trial, and create a Roll-Up Summary field on Clinical Trial to calculate the total count of associated drugs.
- DCreate a custom junction object with Master-Detail relationships to both objects, and set the Organization-Wide Default (OWD) sharing setting on the custom junction object to Private.
Answer
Create a custom junction object with Master-Detail relationships to both Clinical Trial and Investigational Drug, and set the Sharing Setting on the Clinical Trial master-detail field to Read/Write.
Creating a custom junction object with Master-Detail relationships to both parent objects models a many-to-many relationship and enables automatic cascading deletion. Setting the Sharing Setting attribute on the Master-Detail relationship field to Read/Write strictly enforces that users must hold Read/Write edit permissions on the parent Clinical Trial record to create, edit, or delete related junction records.
Step-by-Step Solution
Key Concept
Junction Object Configuration and Master-Detail Sharing Settings
Estimated Time:2m 0s