0
votes

I am currently working on a vf page that has two picklists, and a dependency

Identity Type --controlling picklist AND Identity Status --Dependent picklist

View

<apex:outputField value="{!Identity__c.EE_Identity_Type__c}">
<apex:inputField value="{!Identity__c.Identity_Status__c}"/>

I am unable to set the controlling field as an outputfield "{!Identity__c.EE_Identity_Type__c}", salesforce send an error saying that the controlling field must be editable, but that must not be editable since the user should not be able to change it, this value will come from an integration with another system and the user should only be able to select the available values in the dependent picklist, is there a way to hide EE_Identity_Type__c, using javascript or something, to bypass the salesforce error.

Error Message from Salesforce=

The dependent picklist 'Identity Status' requires its controlling field 'Identity Type' to be present on the page.

Thanks

2

2 Answers

0
votes

Try setting the style to display:none and the label to an empty string

0
votes

Hi Hope it's not too late I've had the same problem and I solved it by use CSS Class like this:

<style>
#controllingField {
            display: none;
        }
</style>

And on your VF page, simply put the controlling field in a div with the same id

    <div id="controllingField">
        <apex:inputField value="{!Case.L1__c}"/>
    </div>

Hope you find this helpful