If you want to selectively determine a record’s fields for display, use the <apex:outputField> component. This component, when embedded in the <apex:pageBlock> component, displays not only the value of the field, but also the field’s label.
- Insert the following into your page to see it in action:Here, account.Name specifies the current account record’s name field, whereas account.Owner.Name looks at the owner field of the account record, and then retrieves that record’s name field.
<apex:pageBlock title="Custom Output"> <apex:pageBlockSection title="Custom Section Title"> <apex:outputField value="{!account.Name}"/> <apex:outputField value="{!account.Owner.Name}"/> </apex:pageBlockSection> </apex:pageBlock>
No comments:
Post a Comment