Opportunity Field Dependency

68 views Asked by At

in my code below the field dependency doesn't work. I read here https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_dependent_picklists.htm that should work. The dependency should work automatically if I add the fields to my page, but it doesn't.

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

Public PageReference SaveNewOpp() {
Opportunity opp = new Opportunity();
opp.AccountId = SelectedAccountId;
opp.Name = oppString.Name;
opp.StageName = oppString.StageName;
opp.Amount = oppString.Amount;
opp.Probability = oppString.Probability;
opp.CloseDate = oppString.CloseDate;
opp.RecordTypeId = oppString.RecordTypeId;
opp.Bewertung_in__c = oppString.Bewertung_in__c;
INSERT opp;
RETURN NULL;
}
1

There are 1 answers

0
Raul On

Which are the dependent fields in your example.

What is exact problem, is the dependent field not changed when you change controlling field or they are not saved properly?