Documentation Version
Winter '16 (API version 35.0)
  • Winter '16 (API version 35.0) 35.0
  • Summer '15 (API version 34.0) 34.0
  • Spring '15 (API version 33.0) 33.0
  • Winter '15 (API version 32.0) 32.0
  • Summer '14 (API version 31.0) 31.0
  • Spring '14 (API version 30.0) 30.0
  • Winter '14 (API version 29.0) 29.0
  • English


A read-only display of a label and value for a field on a Salesforce object. An <apex:outputField> component respects the attributes of the associated field, including how it should be displayed to the user. For example, if the specified <apex:outputField> component is a currency field, the appropriate currency symbol is displayed. Likewise, if the <apex:outputField> component is a lookup field or URL, the value of the field is displayed as a link.

Note that if custom help is defined for the field in Setup, the field must be a child of an <apex:pageBlock> or <apex:pageBlockSectionItem>, and the Salesforce page header must be displayed for the custom help to appear on your Visualforce page. To override the display of custom help, use the <apex:outputField> in the body of an <apex:pageBlockSectionItem>.

The Rich Text Area data type can only be used with this component on pages running API versions greater than 18.0.

This component supports HTML pass-through attributes using the "html-" prefix. Pass-through attributes are attached to the generated container <span> tag.


<!-- For this example to render properly, you must associate the Visualforce page 
with a valid opportunity record in the URL. 
For example, if 001D000000IRt53 is the opportunity ID, the resulting URL should be: 
See the Visualforce Developer's Guide Quick Start Tutorial for more information. -->
<apex:page standardController="Opportunity" tabStyle="Opportunity">
        <apex:pageBlockSection title="Opportunity Information">
            <apex:outputField value="{!}"/>
            <apex:outputField value="{!opportunity.amount}"/>
            <apex:outputField value="{!opportunity.closeDate}"/>


Attribute Name Attribute Type Description Required? API Version Access
dir String The direction in which the generated HTML component should be read. Possible values include "RTL" (right to left) or "LTR" (left to right). 10.0 global
id String An identifier that allows the output field component to be referenced by other components in the page. 10.0 global
label String A string value to be used as component label. 23.0
lang String The base language for the generated HTML output, for example, "en" or "en-US". For more information on this attribute, see the W3C specifications. 10.0 global
rendered Boolean A Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true. 10.0 global
style String The style used to display the output field component, used primarily for adding inline CSS styles. This attribute may not work for all values. If your text requires a class name, use a wrapping span tag. 10.0 global
styleClass String The style class used to display the output field component, used primarily to designate which CSS styles are applied when using an external CSS stylesheet. This attribute may not work for all values. If your text requires a class name, use a wrapping span tag. 10.0 global
title String The text to display as a tooltip when the user's mouse pointer hovers over this component. 10.0 global
value Object A merge field that references the Salesforce field that is associated with this output field. For example, if you want to display an output field for an account's name field, use value="{!}". You cannot associate this output field with a currency merge field if that field value is calculated using dated exchange rates. 10.0 global