I am using two SOQL query in Salesforce.
First Query: Select Id, FirstName, LastName from User where Id='00000ADFEDSFSRTGDR' Second Query: Select IsFrozen from UserLogin where UserId='00000ADFEDSFSRTGDR'
Can we combine these two query into a single query. Please help me on this.
No. If you use "describe" calls on
User
orUserLogin
you'll see they are linked but there's no "relationshipName" field in the describe's result. That's what's used to link, bit like table alias in normal database.So you can do
because
PermissionSetAssignment.AssigneeId
has relationshipName. But notGoing "up" doesn't work either.
SELECT Account.Name FROM Contact
works OK butSELECT IsFrozen, User.Name FROM UserLogin
doesn't. Again - because there's norelationshipName
in the describe results.You'll have to query separately and link them them in code as
Map<Id, User>
for example.