I am trying to come up with an optimal solution for below use case.

I have an org structure like this and There are VPs for each department and A department should not see each others records.

VP Roles(VP Field Engineering,VP Marketing etc..)--->Director--->Manager

The real challenge is a Director can work for multiple VPs. I know we can't assign a user to multiple roles. This is what I have come up with.

  1. Remove Director Role under VP and create a Director role parallel to VP roles
  2. APEX sharing to share records with VP roles based on some field criteria.

Would appreciate any help and any other thoughts?

  • Do the VPs just need access to the Directors' owned records, or are you aiming at getting them the union of the roll-up visibility from each of their Directors and all of their underlings?
    – David Reed
    Jul 3, 2019 at 1:18
  • The second one actually. I am aiming at getting them the union of the roll-up visibility from each of their Directors and all of their underlings. The main challenge here is the Directors work/report for multiple VPs and these directors have sub-ordinates.
    – sdondeti
    Jul 3, 2019 at 2:07

1 Answer 1


Here's one approach that I think will work for your situation. It may not be entirely optimal performance-wise (it creates multiple sharing paths for some users). In the context of your real role hierarchy, you could do some further analysis and optimization.

Suppose we have three organizations, Sales, Support, and Marketing. Each has a VP with their own Role (VP-Sales, VP-Support, and VP-Marketing). There are analogous Director and Manager Roles under each in the hierarchy (Director-Sales, Manager-Sales, and so on).

Now, the Director-Sales works with both the VP-Sales and VP-Support, and the Director-Marketing works with both the VP-Sales and VP-Marketing; we want to expose their entire record hierarchies to both VPs.

We create Public Groups "Sales and Marketing Leadership" and "Sales and Support Leadership". Each group contains the two VPs in question. Then, we create one additional Group per leadership grouping, containing all of the Roles subordinate to the directors in each grouping. So we'd have "Sales and Marketing Roles", for example, containing the roles Director-Sales, Director-Marketing, Manager-Sales, and Manager-Marketing, and so on.

Public Group setup

Then, we create one Owner-Based Sharing Rule for each of those role groups, for each sObject whose visibility needs to be shared. The rule shares records owned by members of the public group (e.g.) "Sales and Marketing Roles" to members of the public group "Sales and Marketing Leadership".

Sharing Rule definition

This example just shares Leads.

I tried this structure out (to the extent possible in a two-user scratch org) and I think it hit the mark you're trying for.

An alternate and simpler solution, if it's applicable to your situation, would be to give the VPs View All permissions and narrow them via Reports that are filtered on other record values. For example, if VP of Sales can get what she needs from a Report or Dashboard filtered by Opportunity Record Type and doesn't need to worry about record visibility, that's an easy solution.

  • The only problem I have here is they have 60+ divisions and we will end up creating too many public groups and sharing rules. Like I said above, I was thinking of a custom metadata type to maintain the department and hierarchy mappings and use Apex sharing. I need to do a POC on that. Thanks your help and really great insight.
    – sdondeti
    Jul 4, 2019 at 15:44
  • @sdondeti That approach will work (Apex sharing), but it's one I always try to avoid because of (1) just how much code it involves and (2) the fact that standard objects only support Apex-mediated manual sharing. That said, if you get a POC working, I'd love to read a write-up.
    – David Reed
    Jul 4, 2019 at 16:03
  • Agree with you on the Apex sharing limitations. I am leaning towards ViewAll for VPs then build role hierarchy for Directors-->Managers for each department and use filters in reports.
    – sdondeti
    Jul 4, 2019 at 17:10

You must log in to answer this question.

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