I am struggling with the createdby reference and hope someone could help me out. I have a custom object and as everyone knows there is a standard createdbyId created on every custom object. We can use Createdby.Name to get the the name of the creator. I have created a custom picklist field Type__c on standard user object and want to use Createdby.Type__c to get the user type info.However I got the error "No such column 'Type__c' 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."

Select id,createdby.username,createdby.id,createdby.email,createdby.IsActive,CreatedById,Createdby.Type__c from sampleobject__c

Is this possible to reference custom field on standard user object using createdby?

Thany you.

  • have you found any solution to this? I believe this has something to do with polymorphic keys, but I haven't found any solution/workaround yet. – SamuelDev Sep 26 '16 at 22:55

Custom Field on User object can be accessed in SOQL like standard fields. In your case check make the field is visible to the user. (Customize > Users > Fields > Type(or whichever custom field is created) Click on button > 'Set Field Level Security' Make it visible to your profile.

That's it.

  • Thanks for your input, I am the administrator, and the Type__c on User Standard object is visible to me. I can access this field using SOQL query, however my question here is, I can not access user custom field while I am querying other object(no matter custom or standard object) by Createdby.Type__c. – Shuo Wang Jul 5 '16 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.