0

In an Account Object a field called ‘Sales Person‘ and it has lookup relation with the user object. If the user is selected as the salesperson for a record, that user able to see those records, but OWD is private, record owner and admin will not share any records.

1
  • Is there a reason why you're not leveraging record ownership for this use case? Dec 11, 2019 at 0:30

1 Answer 1

2

This appears to me to be a textbook use case for Apex-Managed Manual Sharing.

You'd use a trigger on the Account object to programmatically insert and maintain AccountShare records. The trigger would need to react to changes in the lookup field, as well as to changes of ownership (since Manual sharing records don't survive ownership changes). It'd remove any shares to the previously-assigned Sales Person and create and insert new shares for the new value.

True Apex-Managed Sharing is not available on standard objects.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .