Skip to main content
Bharath R (Accenture) 님이 #Experience Cloud에 질문했습니다

1. Both Distributors and Dealers are created from Accounts. Used Distributor Dealer Mapping Object as junction to map multiple Dealers to each Distributor and vice versa. Dealer is a Master Detail Relationship and Distributor is a Lookup Relationship.     When login as a Branch Distributor, I can view Distributor record but unable to view mapped Dealers in Dealer tab in experience cloud (created list view with filter Dealer).    What is the approach for the Dealer visibility?    2. Used sharing sets for the data visibility. Able to view data when login as branch Distributor but need visibility of records to parent Account of branch Distributors such as Accounts, Orders, Invoices etc.    What is the approach for data visibility to parent Account?   

답변 1개
  1. 7월 30일 오후 4:45

    Hi Bharath, 

     

    Both of these are common limitations with Sharing Sets once you get beyond simple one-hop, single-object visibility. Here's the breakdown for each: 

     

    1. Dealer visibility issue 

     

    The core problem is how Master-Detail sharing actually flows. On your junction object: 

    - Dealer is Master-Detail → the junction record's sharing/visibility is inherited FROM Dealer (parent controls child access) 

    - Distributor is Lookup → no implicit sharing relationship in either direction 

     

    This means: even if a user can see the Distributor record and the junction record, that does NOT grant them access to the Dealer record itself. Access flows downward from Master to Detail (Dealer → Junction), never upward or sideways. So your Distributor user seeing the junction row still can't see the related Dealer Account unless Dealer is shared with them directly and separately. 

     

    Since Dealers are Accounts (many-to-many via the junction, not a single parent), a single Sharing Set access mapping won't work cleanly here — Sharing Sets are designed for one direct field match (e.g., a lookup field on the target object pointing back to the user's Account/Contact), and a Dealer can map to multiple Distributors, so there's no single static field to map against. 

     

    Recommended approach: Apex Managed Sharing 

    - Write a trigger (or a Flow calling an Apex action) on Distributor_Dealer_Mapping__c that fires on insert/update 

    - When a mapping record is created linking a Dealer to a Distributor, programmatically create an AccountShare record granting Read (or Edit) access on the Dealer Account to the Distributor's related community users 

    - This explicitly grants the access that Master-Detail/Lookup relationships and Sharing Sets can't provide automatically for this many-to-many pattern 

    - If a mapping is deleted, make sure to also remove the corresponding AccountShare to keep access accurate 

     

    This is the standard pattern anytime you have a many-to-many junction and need cross-visibility that doesn't follow simple parent-child sharing. 

     

    2. Parent Account visibility for branch distributor users 

     

    This is a known constraint of Sharing Sets specifically: Sharing Sets only grant access based on a single field match to the record directly associated with the logged-in user's own Account/Contact — there's no concept of "also see my parent account's data" built into Sharing Sets, since Sharing Sets are typically used for license types (e.g., Customer Community / high-volume login licenses) that don't get a Role Hierarchy. 

     

    If you need hierarchy-aware visibility (branch distributor seeing parent distributor's Accounts, Orders, Invoices), you have two real options: 

     

    Option A: Switch to a license type with Portal Roles (if feasible) 

    Partner Community or Customer Community Plus licenses generate an automatic Role per external Account, and that role hierarchy respects your Account's Parent Account field. With standard sharing (Grant Access Using Hierarchies enabled, which is default), users higher in that hierarchy automatically see records shared to accounts below them. This is the "native" way to solve parent/child visibility, but it's a licensing change, not just a config change — worth checking if your current license supports this before going further. 

     

    Option B: Apex Managed Sharing (if staying on your current license) 

    Same pattern as above — when a Branch Distributor's Account is linked to a Parent Distributor Account, programmatically create Share records (AccountShare, OrderShare, custom object shares, etc.) granting the branch user's Account/community users access to the parent's records. This needs to run whenever the parent-child Account relationship is established or changed, and needs to be built out per object (Account, Order, Invoice, etc.) since each share type is separate. 

     

    Given you're already on Sharing Sets (suggesting a license without native Role Hierarchy), Option B (Apex Managed Sharing) is likely your most practical path for both problems — it's more work upfront but gives you full control over exactly which records propagate to which users, including the many-to-many Dealer case and the hierarchical parent-account case.

0/9000