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
anjin reddy 9anjin reddy 9 

How to get description of each fields along with its field name in visualforce page in salesforce

Hi friends,
 
 could you please suggest me to solve the below the question

How to get description of each fields along with its field name of objects in visualforce page in salesforce?
 
  

Thanks
Anjin
 
Abhishek BansalAbhishek Bansal
Hi Anjin,


Unfortunately, description seems to be the one field that is not included in the getDescribe() method (See full list of available information here (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_describesobjects_describesobjectresult.htm#field_topic)). One alternative that you may be able to use instead is to pull the inline help text which is set alongside of the description. I don't know your use-case though, so I'm not sure if that would help you much or not.

String fieldHelpText = Object_Name__c.Field_Name__c.getDescribe().getInlineHelpText();

The down side of using the Help Text is that any contents are visible in Standard View pages to all users which have access to the field.

Again, I don't know the full scenario for why you need this functionality, but you might also want to look into using Custom Settings. You could create a map of each field and its description (or whatever information you're trying to gather).

Regards,
Abhishek.
anjin reddy 9anjin reddy 9
Hi Abhishek,

   whatEver you have give the code is helped us much.

Actually my requirement is to get all fields and label,data type and discription of each fields has to display in Visualforce .

Could you please help us 
Thanks