The SObjectField class has a getDescribe() method. Does anyone know of a creative way to get the field label for use in Apex? There does not seem to be a getLabel() method per the official documentation.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:
Sign up
Sign up
Here's how it works:
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
|
|
As you mentioned, you need to call
|
|||
|
|
|
You can get a field's label using the following one-liner:
|
|||
|
|