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
Dman100Dman100 

override inputField label

I have several inputFields where the value is set to the account ownerid.  Is it possible to override the label?

 

<apex:page standardController="Account"> <h1>Manage Salesperson Territory Assignments</h1> <apex:form > <apex:pageBlock title="Update Specific District or Account Ownership" mode="edit"> <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Update"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Used to update owner of specified account and related child accounts" columns="1"> <apex:inputField value="{!account.ownerId}"/> <apex:inputField value="{!account.ownerId}"/> <apex:inputField value="{!account.parentId}"/> </apex:pageBlockSection> </apex:pageBlock> <apex:pageBlock title="Update Account Ownership by State" mode="edit"> <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Update"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Used to update owner of accounts by selected state" columns="1"> <apex:inputField value="{!account.ownerId}"/> <apex:inputField value="{!account.State__c}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

I would like to change the labels for the account owner inputFields to:

 

"Change Owner From:"

"Change Owner To:"

 

Is this possible?

Best Answer chosen by Admin (Salesforce Developers) 
ThomasTTThomasTT

Use apex:pageBlockSectionItem in section. In the sectonItem, the 1st element is handled as label, 2nd is the value.

ThomasTT

 

            <apex:pageBlockSection title="Used to update owner of specified account and related child accounts" columns="1">
<apex:pageBlockSectionItem>
<apex:outputLabel>Owner From</outputLabel>
<apex:inputField value="{!account.ownerId}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem>
<apex:outputLabel>Owner To</outputLabel>
<apex:inputField value="{!account.ownerId}"/>
</apex:pageBlockSectionItem>
<apex:inputField value="{!account.parentId}"/>
</apex:pageBlockSection>

 

            <apex:pageBlockSection title="Used to update owner of accounts by selected state" columns="1">
<apex:pageBlockSectionItem>
<apex:outputLabel><apex:inputField value="{!account.ownerId}"/>
<apex:inputField value="{!account.State__c}"/>
</apex:pageBlockSection>

 

Message Edited by ThomasTT on 10-08-2009 10:12 PM