Friday 26 September 2014

How to get help text in apex class ??

We generally use help text while creating custom field in salesforce . Sometimes we need it in apex controller while development. This post is regarding to get help text of particular field and display in vf page. 

Here is some code snippet to get help text in apex class.

Schema.DescribeFieldResult dfr = Schema.sObjectType.Account.fields.TestField__c;
String helptext = dfr.getSObjectField().getDescribe().getInlineHelpText();

In the visualforce page we can display help text.

{!$ObjectType.Account.fields.TestField__c.inlineHelpText}

No comments: