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
Sascha DeinertSascha Deinert 

Opportunity two fields dependency


I add a new visualforce page to add new opportunities.
That works fine, but I want that the fields StageName and Probability are in dependency.
These fields are the standardfields from the object opportunity and it works if I use the standardopportunity case in salesforce.
If I change the StageName should change also the Probability.

<apex:pageblock title="Verkaufschance Übersicht" id="pbOpp" mode="inlineEdit">
    <apex:pageBlockButtons location="top">
        <apex:commandButton action="{!SaveNewOpp}" value="Save" id="saveButton1" rerender="pbOpp" rendered="{!IF(newOpp=1,true,false)}"/>
        <apex:commandButton action="{!CancelNewOpp}" value="Cancel" id="cancelButton1" immediate="true" rendered="{!IF(newOpp=1,true,false)}"/>
    <apex:pageBlockSection rendered="{!IF(newOpp=1,true,false)}" columns="2">
        <apex:inputField value="{!oppString.RecordTypeId}"/>    
        <apex:inputField value="{!oppString.Name}"/>
        <apex:inputField value="{!oppString.StageName}"/>        
        <apex:inputField value="{!oppString.Amount}"/>
        <apex:inputField value="{!oppString.Probability}"/>
        <apex:inputField value="{!oppString.Bewertung_in__c}"/>
        <apex:inputField value="{!oppString.CloseDate}"/>

Mohit Bansal6Mohit Bansal6

I couldn't understand your issue.

Kindly brief your problem in detail.
Sascha DeinertSascha Deinert

If I change the stage from an opportunity the probability will change also. This is the standardconfiguration in salesforce if I use the standardform to add a new or change a opportunity.

But I write a visualforce page to add and change the opportunity and this dependency doesn't work.#

Is that more clear