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
Rupesh Karn 8Rupesh Karn 8 

Home Page customization query

Hi Folks,
Good day to all!
I have a requirement to display user details and all the users reporting to this user in role heirarchy in a related list below on home page.

I tried achieving this using LIghtning Flow but this solutioon failed as i wasn't able to hide Finish button by giving an alternative custom component as this solution wasn't acceptable to the end user.

Please suggest whether this was achievable through lightning component code. Also, it would be of immense help if someone could share some sample code.
NagendraNagendra (Salesforce Developers) 
Hi Rupesh,

First, you'll need to query all roles and parse hierarchy in-memory. You'll need to end up a list of all the roles beneath the logged in users. With that list in hand, you can query all the users belonging to those roles. 

Once you have the list, you'll probably want to populate a lightning tree grid component to display the users.

Thanks,
Nagendra