1

enter image description here

I want to get the Users which report to a particular user (A manager) by using the Hierarchical Relationship inside the User Object. Appreciate if someone can give an example.

Small clarification:

How can I get the users from the Manager's point of view (What I need to do here is identify the users who are managers by looking at the availability of his/her child users via the Hierarchical Relationship (in my case field name is Planner__c) ). I have used the query like this. but it not working.

SELECT Name (SELECT Id,Name FROM Planner__r) FROM User
0

2 Answers 2

4

A simple SOQL will work here.

SELECT UserName, Id, Manager.Name, Manager.Id, Manager.Profile.Name FROM User

if it's a new custom field you can refer the same.

0

From the Manager's perspective I have managed to generate the query. Problem was I could't find the child relationship name. Thanks for all our answers.

SELECT Name, (SELECT Id,Name FROM Users1__r) FROM User

You must log in to answer this question.

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