You need to sign in to do that
Don't have an account?
EmployeeNumber field of User object is not accessible
Hi,
Not accessible EmployeeNumber field of User object from Attachment Query whereas Name, Alias are accessible.
Plesae explain why am I not able to access EmployeeNumber.
API Version - 33.0
My Query is - SELECT Id,Name, CreatedBy.EmloyeeNumber FROM Attachment
Error - INVALID_FIELD:
SELECT Id,Name, CreatedBy.EmloyeeNumber FROM Attachment
^
ERROR at Row:1:Column:17
No such column 'EmloyeeNumber' on entity 'Name'. 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.
Thanks.
Not accessible EmployeeNumber field of User object from Attachment Query whereas Name, Alias are accessible.
Plesae explain why am I not able to access EmployeeNumber.
API Version - 33.0
My Query is - SELECT Id,Name, CreatedBy.EmloyeeNumber FROM Attachment
Error - INVALID_FIELD:
SELECT Id,Name, CreatedBy.EmloyeeNumber FROM Attachment
^
ERROR at Row:1:Column:17
No such column 'EmloyeeNumber' on entity 'Name'. 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.
Thanks.
I checked on that and even I got the same error , upon further investigation I found out created by is Polymorphic field which is pointing to more that one type of object
please refer http://www.tgerm.com/2010/11/no-such-column-on-entity-error.html
therefore you have to writer seperate query on user object to get the EmployeeNumber field of created by user
hope this helps
All Answers
fyi : every custom fields api name is differnt from its label .
Saleaforce appends __c to fields label and replace spaces with _ when generating api names
eg: if field label is Employee Number api name would be Employee_Number__c
I am using standard Attachment object but I am referring createdBy User field and trying to get createdBy user's EmployeeNumber field. Which is also standard field of User object. I am able to access Id, Name, Alias of User field using createdBy.Id, createdBy.Name, createdBy.Alias but whenever I try createdBy.EmployeeNumber field then I get error 'No such column on user entity'.
Is there any security restriction on EmployeeNumber field of User object ?? OR
Is there any API version issue ?? (currently using 33.0 API version)
Thanks.
I checked on that and even I got the same error , upon further investigation I found out created by is Polymorphic field which is pointing to more that one type of object
please refer http://www.tgerm.com/2010/11/no-such-column-on-entity-error.html
therefore you have to writer seperate query on user object to get the EmployeeNumber field of created by user
hope this helps
Regards,
Micheal.