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
IanDoneganIanDonegan 

Cross-object SOQL query (UserLogin to User) failing with INVALID_FIELD

Hello, All.

I am trying to get information about users including IsActive and IsFrozen. IsActive is on the User object while IsFrozen is on the UserLogin object. The UserLogin object contains a User lookup field with an API name of UserId, (According to this documentation page: https://developer.salesforce.com/docs/atlas.en-us.sfFieldRef.meta/sfFieldRef/salesforce_field_reference_UserLogin.htm)

Queries to the UserLogin work fine:
/services/data/v45.0/query/?q=select+Id,IsFrozen,UserId+from+UserLogin

Queries to the User work fine:
/services/data/v45.0/query/?q=select+Id,IsActive+from+User

But combining the two into one query fails:
/services/data/v45.0/query/?q=select+Id,IsFrozen,UserId,UserId.IsActive+from+UserLogin

I am modeling my combined query after the another cross-object query that I have verified is working correctly:
/services/data/v45.0/query/?q=select+Id,Account.Name+from+Contact

What am I doing wrong here?



 
Best Answer chosen by IanDonegan
Raghu NaniRaghu Nani
Hi Even i am tried, not able to access any fields from user. It looks like limitation

All Answers

Raghu NaniRaghu Nani
Hi Even i am tried, not able to access any fields from user. It looks like limitation
This was selected as the best answer
IanDoneganIanDonegan
Thanks for confirmation, Raghu. At least I know that it is not a problem specific to me. Does anyone know an approved way to handle this? I suppose that I could just do two callouts, but I am trying to avoid governer limit issues. It seems odd to keep this information on two different objects and then not have them simultaniously queriable.