You need to sign in to do that
Don't have an account?
IanDonegan
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:
Queries to the User work fine:
But combining the two into one query fails:
I am modeling my combined query after the another cross-object query that I have verified is working correctly:
What am I doing wrong here?
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?
All Answers