Salesforce Certified Platform Developer II — Question 18
Universal Containers implements a private sharing model for the Convention_Attendee_ _c custom object. As part of a new quality assurance effort, the company created an Event_Reviewer_ _c user lookup field on the object. Management wants the event reviewer to automatically gain Read/Write access to every record they are assigned to.
What is the best approach to ensure the assigned reviewer obtains Read/Write access to the record?
Answer options
- A. Create a criteria-based sharing rule on the Convention Attendee custom object to share the records to a group of Event Reviewers.
- B. Create an After Insert trigger on the Convention Attendee custom object, and use Apex Sharing Reasons and Apex Managed Sharing.
- C. Create criteria-based sharing rules on the Convention Attendee custom object to share the records with the Event Reviewers.
- D. Create a Before Insert trigger on the Convention Attendee custom object, and use Apex Sharing Reasons and Apex Managed Sharing.
Correct answer: D
Explanation
The correct answer is D because a Before Insert trigger allows you to set sharing rules at the time of record creation, ensuring that the assigned reviewer gets Read/Write access immediately. Options A and C focus on using criteria-based sharing rules, which are not effective for granting access at the creation time of records. Option B uses an After Insert trigger, which does not provide immediate access and is less efficient for this requirement.