Select name , ownerid from invoice__c
yields this.
Name OwnerId
1 INV-0001 005j000000BCqsYAAT
2 INV-0000 005j000000BCqsYAAT
3 INV-0002 005j000000BCqsYAAT
4 INV-0003 005j000000BCqsYAAT
5 INV-0004 005j000000BEVxqAAH
but i want to join the query to the user table.
i tried this, but i get query errors.
Select name , ownerid , user__r.name from invoice__c
i also tried
Select name , ownerid , user.name from invoice__c
[ERROR:]INVALID_FIELD:
Select name , ownerid , user__r.name from invoice__c
^
ERROR at Row:1:Column:25
Didn't understand relationship 'user__r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
3 respostas
You can write an SOQL query like:
select name, ownerid, owner.name from invoice__c
This should yield you the output:
INV-0001 005j000000BCqsYAAT Phyllis Cotton
Hope this helps.