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
SiddharthSiddharth 

Unable to query Owner.ManagerId field from Lead

Hi,

 

My query "Select l.Owner.ManagerId, l.OwnerId, l.Name From Lead l" is not giving me any results. I have tried using eclipse, SForce explorer and even th debugger, but it returns "No such column 'ManagerId' on entity 'Name'." I am able to access all other fields from the User object.

 

Can someone confirm me if this is a bug or whether this field is not accessible.

 

Thanking you in anticipation

 

Siddharth

SuperfellSuperfell

The Owner field on lead is polymorphic (it can be a user or a group) and as such, the relationship in SOQL is to a subset of fields in the sobject type called Name (as hinted to by the error message), managerId is not one of the fields in the Name subset.

SiddharthSiddharth

Thanks for the update Simon. So that means we would have to query this field from user additionaly and can nevr be directly fetched.