Salesforce Certified Sharing and Visibility Architect — Question 13
What should a Salesforce architect recommend to make sure that users that gained access to a custom object record through Apex managed sharing do not lose access to it when its owner is changed?
Answer options
- A. Use “With Sharing” keyword to make sure record visibility will be considered.
- B. Create a specific Apex Sharing Reason for the custom object.
- C. Create a new record in _Share object with RowCause “Manual”.
- D. Use “runAs” system method in Apex classes to enforce visibility.
Correct answer: B
Explanation
The correct answer is B because creating a specific Apex Sharing Reason allows the sharing rules to persist even when the ownership of the record changes. Option A is incorrect as 'With Sharing' controls class-level visibility but does not manage record sharing. Option C would not ensure continuity of access through ownership changes, and option D does not pertain to maintaining record access during ownership changes.