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
Gourav JainGourav Jain 

We can use the following syntax to retrieve the label of custom field on VF page.

Example: $ObjectType.Object__c.Fields.CustomField__c.Label

But, How to retrieve Label of Custom Field in Apex class?

Best Answer chosen by Admin (Salesforce Developers) 
rohitsfdcrohitsfdc

hi,

You can access the label using describe method

 

Schema.DescribeFieldResult F = contact.activate__c.getDescribe();
string a = f.getLabel();