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
amarnijeramarnijer 

how to access roles and subordinates share data in apex dynamically

Hi

In OWD Lead is Private and Role hierarchy is checked. I need to get all lead records for a user where the lead data are shared to a top label role and its subordinates of that user. for example some user "X" shared data with "A and  its Subordinates". Now C reports to B, B reports to A. How A can see all records of B (What B can view). I Need to do this using Apex. Please some one give some solution.

 

Thanks.