Tuesday, September 25, 2012

To get "probability" field values assigned automatically when selecting "Stage" field on opportunity through VF page

When selecting the "Stage" field on creating new Opportunity record through standard page , "probability" field get values automatically.

But when you access both the fields using inputField in VF page ; it do not gives the values automatically .

For e.g :- just copy\paste this code in VF page and try to select the "Stage" field ; it will not render the value of Probability field.

<apex:page standardController="Opportunity">

<apex:inputField value="{!Opportunity.StageName}"/>
<apex:inputField value="{!Opportunity.Probability}"/>