PDII practice question 7 of 10
Universal Containers implements a private sharing model for the Convention Attendee co custom object. As part of a new quality assurance effort, the…
Full set: 198 questionsImplementing dynamic, record-level access based on a custom lookup field requires Apex Managed Sharing. Standard criteria-based sharing rules cannot dynamically share a record directly to a user referenced dynamically in a record's lookup field; they strictly rely on static configurations or role hierarchies. Through Apex Managed Sharing, a share record (e.g., Convention_AttendeeShare) is programmatically instantiated and related to the parent record using an Apex Sharing Reason. Because share records inherently require an existing Parent ID to act upon, this programmatic logic must execute in an after context (after insert or after update). Attempting to instantiate the share record during a before trigger will definitively fail, as the newly created parent record lacks a Salesforce ID at that specific execution phase.
A. A before insert trigger executes prior to the record being saved, meaning the record does not yet possess an ID, rendering the creation of share records impossible.
C. Criteria-based sharing rules evaluate static data and cannot dynamically reference a user specified dynamically within a custom lookup field on individual records.
D. Sharing rules assign access to defined Public Groups or Roles and cannot be utilized to share specific records to distinct, individual users identified dynamically by a lookup.
Salesforce Apex Developer Guide, "Apex Managed Sharing", Section: Creating and Deleting Apex Managed Sharing.
Salesforce Apex Developer Guide, "Triggers", Section: Trigger Event Types.
Keep practicing
Take the free PDII practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other PDII practice questions
- Question 3Which three Visualforce components can be used to initiate Ajax behavior to perform parti…
- Question 4A user receives the generic "An internal server error has occurred” while interacting wit…
- Question 5A developer is asked to develop a new AppFxchange application. A feature of the program c…
- Question 8Universal Containers develops a Visualforce page that requires the inclusion of external …
- Question 9A developer is trying to access org data from within a test class. Which sObject type req…
- Question 10A company has a Lightning page with many Lightning Components, some that cache reference …
