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
ADMIN DMIADMIN DMI 

Change name dynamically for custom fields

Hi
I created customs field(Forecast_Revenue_Month1__c) in opportunity with data type (currency).
I need to assign  name for field with out affect value.(I would like to get the result as below img)

User-added image

My apex class code
opp.Forecast_Revenue_Month1__c= 'January';
And my VFP
<apex:inputField label="{!opportunity.Forecast_Revenue_Month1__c}" value="{!opportunity.Forecast_Revenue_Month1__c}" </apex:inputField>

But i got type conversion error on this?
can any one help me out ?
pconpcon
You could do this with an <apex:outputLabel> combined with an <apex:inputField> and do a <apex:actionSupport event="onchange"> to refresh the outputLabel with text from your controller.  If these are static (ie Month1__c is ALWAYS 'January' you could just do:

<apex:outputLabel for="month1" value="January" />
<apex:inputField value="{!opportunity.Forcase_Revenue_Month1__c}" id="month1" />

and repeat for every month.  If this varies from page load to page load, but NOT with the data on the page updates, you could just add to your controller
public static String getMonth1() {
     return 'January'; //Real code to generate string should go here
}
and have you VF page do

<apex:outputLabel for="month1" value="{!month1}" />
<apex:inputField value="{!opportunity.Forcase_Revenue_Month1__c}" id="month1" />