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
yogesh.rankawatyogesh.rankawat 

Manager of a User

Hi,

How to find a Manager of a user in a query using UserId?
I have not found 'manager' field in sforce Explorer.

Please fix this problem.

Thanks
BoxBox

I believe your looking for the ManagerID relationship.  The following SOQL query shows the relationship.

Select u.Id, u.Name, u.ManagerId, u.Manager.Name From User u

yogesh.rankawatyogesh.rankawat
Sorry.......

Its not working 'Select u.Id, u.Name, u.ManagerId, u.Manager.Name From User u'

Its give error:  No such column 'ManagerId' on entity 'User'.


BDArnzBDArnz
It's scary this this thread died back in June '08 without a solution.  I'm finding the same problem.  Did anyone figure out how to solve it?
OnDem DevOnDem Dev

Hi,

 

I guess you are trying the below query from an SControl using "sforce.connection.query".

'Select u.Id, u.Name, u.ManagerId, u.Manager.Name From User u'

 

In that scenario, the above query will not work.

 

Write an Apex Webservice method that returns the result of the above query back to SControl.

Use sforce.apex.execute instead of sforce.connection.query

 

Hope this helps.

 

Thanks

ASVERMAASVERMA

Hi Guys,

 

I am directly able to run below query from SForce explorer.

 

Select u.Id, u.Name, u.ManagerId, u.Manager.Name From User u

 

I think, when the issue got arise, Salesforece was not providing joins/ relationships. But currently there is no issue.

 

-Ashutosh Verma