You need to sign in to do that
Don't have an account?

SOQL Relationship Query for User fields
Guys,
I may be going crazy but trying to pull in joined User fields appears to work only for a few fields like FirstName, LastName and Alias. All other standard and custom fields appear to the API as non-existent and return an error.
Example:
This query works fine:
Select Id, Task.Owner.FirstName from Task where Task.Id = '<some Task Id>'
But this one does not:
Select Id, Task.Owner.City from Task where Task.Id = '<some Task Id>'
result: non-existent field error on City.
This does not have anything to do with field-level-security because you can't set FLS on the User object.
What is happening here?
I may be going crazy but trying to pull in joined User fields appears to work only for a few fields like FirstName, LastName and Alias. All other standard and custom fields appear to the API as non-existent and return an error.
Example:
This query works fine:
Select Id, Task.Owner.FirstName from Task where Task.Id = '<some Task Id>'
But this one does not:
Select Id, Task.Owner.City from Task where Task.Id = '<some Task Id>'
result: non-existent field error on City.
This does not have anything to do with field-level-security because you can't set FLS on the User object.
What is happening here?
Search for "Understanding Polymorphic Keys and Relationships" in the API doc.