You need to sign in to do that
Don't have an account?
Bart Dewveall
SOQL query using Lookup relationship fields.
Hello, I have a custom object with three lookup fields, one to User one to Contact and one to Account. I'm executing the following query but it complains about the relationship in getting the name from the User object. If I exclude User__r.Name from the query It returns the Contact and Account Names OK. Any help would be appreciated.
SELECT User__r.Name, Number_Tickets_Requested__c, Contact__r.Name, Account__r.Name FROM SFL1_Ticket_Req__c
SELECT User__r.Name, Number_Tickets_Requested__c, Contact__r.Name, Account__r.Name FROM SFL1_Ticket_Req__c
Head In Cloud
Hi, Can you please check the API name for the user lookup field you created. Is it User__c ? or if you are trying to get the owner name of standard field, then you should use owner.name in your query
Rahul Boinepally
Adding to Head In Cloud's answer - just check your access to user object if you have read access.
Bart Dewveall
The API name of the Lookup to user object is Requester__c.