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
Salesforce BlitzSalesforce Blitz 

find parent user name of user in apex

I have a user, who has a different as head in role hierarchy.

I need to fetch the parent user name of given user

Rupali PophaliyaRupali Pophaliya
Here is a way to find users who works beneath logged in user or parent in the role hierarchy.
Salesforce BlitzSalesforce Blitz
I need to get the parent role of given user.

Bottom-up approach.