I'm trying to write a SOQL query that will grab one of the Contact object's standard fields "Contact Owner", which is a Lookup(User) field:
The field name is "Owner", but when I try to query
SELECT Contact.Owner FROM Contact
I get an error stating that there is no such field.
SELECT Contact.Owner, Contact.Name, Contact.Rule_Class__c
^
ERROR at Row:1:Column:8
No such column 'Owner' on entity 'Contact'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
How can I grab this field?
Thank you!
That's a normal behavior for Relation fields
You can imagine OwnerId
as an alias
SELECT LastModifiedBy.Name, LastModifiedBy.Id, LastModifiedById FROM Contact
SELECT CreatedBy.Name, CreatedBy.Id, CreatedById FROM Contact
Also use Workbench or Developer console or Eclipse to construct your queries instead of using salesforce setup interface
Workbench
Developer Console