+ Start a Discussion
Tulasiram ChippalaTulasiram Chippala 

how to get createdby of a custom field

How to get field createdby for a custom field.....
User-added image
Khan AnasKhan Anas (Salesforce Developers) 
Hi Ram,

Greetings to you!

Use below query:
SELECT Name, CreatedDate, CreatedBy.name FROM Student__c WHERE CreatedDate < TODAY

You can also use Tooling API (https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/reference_objects_list.htm) Objects to get the Created Date of metadata (not all but some supported ones).

For example, executing a sample query in the query editor tab of the developer console will be like this.
 
SELECT DeveloperName, CreatedDate, CreatedBy.name FROM CustomObject WHERE CreatedDate < TODAY

NOTE: Make sure to check the 'Use Tooling API' checkbox beside 'Execute' button.

Also, you can find this information in the Setup Audit Trail (https://help.salesforce.com/articleView?id=admin_monitorsetup.htm&type=5). The view Setup Audit Trail will track all metadata changes including object, fields, layouts, class, page etc. and displays the latest 20 changes.
If you want to see the last 6 months metadata changes need to download the CSV file.

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Raj VakatiRaj Vakati
What you are trying to do 

If you want to use it in SOQL


Select Id , Createdby.Name ,Createdby.Id from Object where Id='0000000000000000001'


if you want to get the values from the Apex


Account a = new Account() ;
a.Name='Test';
insert a ; 

String createdName = a.CreatedBy.Name ; 


If you want to query the value using tooling about the field


SELECT DeveloperName, CreatedDate, CreatedBy.name FROM CustomObject WHERE CreatedDate < TODAY


 
Tulasiram ChippalaTulasiram Chippala
Hi Raj,

Select Id , Createdby.Name ,Createdby.Id from Camping_Item__c where Id='00N7F00000QepTI' 

i am using above query but no luck.