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
Sri Sri 11Sri Sri 11 

Owner name for a Account in soql

Hi,
I am trying get owner name of an account like we see in UI using soql, which i will pass to rest service. I understand that there is releation between Account and User. i am trying to the following query but i am getting errors.
select+name,user.name+from+account
message: select name,user.name from account ^ ERROR at Row:1:Column:13 Didn't understand relationship 'user' 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.
errorCode: INVALID_FIELD
Can some one provide how to get this?
 
Chandra Sekhar CH N VChandra Sekhar CH N V
You should use 'Owner.name' to get account owner :

select name,owner.name from account
JAGDISH MOREJAGDISH MORE
plese tell me why only to quory account owner field we need to wrtie as owner.name but  not for other fields such as name,site..... 
anil sepuranil sepur
Select id,name,Phone,Account.Id,Account.OwnerId,Account.Name,owner.name from contact 

If it works please like