You need to sign in to do that
Don't have an account?
Newbie999
why do we have to write owner.name instead of api name owner
In the below query: SELECT Id, Name, Industry, AnnualRevenue, ( SELECT Name, Email, BirthDate FROM Contacts ) FROM Account where name != null limit 5, why writing owner does not return records and we have to write owner.name. While writing name returns records
Owner is a type of Lookup field, And we have to use Dot(.) Operator to get the associated information from lookup field (Relationship field).
E.g. Owner.name, CreatedBy.name etc.
Please follow the below link for detailed information and understand Relationship Queries.
http://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships.htm
All Answers
Owner is a type of Lookup field, And we have to use Dot(.) Operator to get the associated information from lookup field (Relationship field).
E.g. Owner.name, CreatedBy.name etc.
Please follow the below link for detailed information and understand Relationship Queries.
http://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships.htm