function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vibrationvibration 

How to get a date in created by fields in VF page?

How to get a date in created by fields in VF page?

ktshannonktshannon

Are you trying to pull the CreatedDate for each field?

Ankit AroraAnkit Arora

CreatedBy field is a reference field, if you are talking about createddate then simply inpufield will help you to display the date. But if you want to edit the date field then sorry createddate is a read only field, but if you want to edit that field then you need to log a case in salesforce.

 

When salesforce notify you that your organization is on audit trail then I think you can change the createddate field, else there is no way out.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

vibrationvibration

thanks . i want to display only created by( date )in visualforce page. created by contains(username and date). i want date only

Ankit AroraAnkit Arora

CreatedBy is showing creator of the record and the date when it is created. If you want to get the date from this field you need to do something like this :

 

Account acc = [select id,createddate from account Limit 1] ;
System.debug('Created Date :::: ' + acc.createddate) ;

 

Hope this will resolve your problem.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page