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
Venkatesh SVenkatesh S 

How to display all custom field and the field created date in developer console for the opportunity object

Hi all,

How to display all custom field and the field created date in developer console for the opportunity object.

I have tried some, but it display only field name.  can you please help me to display its created date also.

Map <String, Schema.SObjectField> fieldMap= opportunity.sObjectType.getDescribe().fields.getMap();
for(Schema.SObjectField sfield : fieldMap.Values())
{
schema.describefieldresult dfield = sfield.getDescribe();
if(sfield.getDescribe().isCustom())
system.debug('------' + dfield.getName());
}


Thanks.
AshlekhAshlekh
Hi,

By describe call you can get all the fields but not the data of metadata. You are trying to pull the information of Data of Data os yuou need Meta API or tooling api for this.

-Thanks
Ashlekh Gera