function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
wadams2010wadams2010 

Is Apex Managed Sharing required to automatically update record sharing based on set criteria?

Hello all!

I got pretty far with this discussion yesterday on the Salesforce Success boards but I think the question needs to be asked to the developers board now.

In my example we have an Account with Contacts where specific Contacts have a different owner than the Account Owner. What I need to do is to have all the Contacts that are not owned by the Contact's Account Owner restricted from the Account Owner's view.

In a sandbox I have rolled all the OWD back to Private for Account, Contract and Asset, Contact, Opportunity, and Case to Private. Without adding any Record Sharing Rules, the Account Owner is still able to see the Account's Contact that the person does not own. The reason given when I drill down using the Sharing button is that the 'Reason for Access' is 'Account Sharing'. However, if I got to the Account level as an Admin, click Sharing, click Edit next to the Account Owner and set the Contact Access as Private, all is well.

I have seen documentation about using Apex Managed Sharing to automatically update the Sharing set-up. I am wondering if there is any way to not have to use Apex to complete this requirement. Would this be possible?

Thanks in advance!