Get a Field Label in a Visualforce Page

You can access the Label attribute of a field directly from a Visualforce page by using the following:


<apex:outputLabel value="{!$ObjectType.Account.fields.Name.label}" />

This gets the label for the “Name” field from the “Account” object.  You can interchange any sObject name and it’s corresponding field as needed.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s