I am working on visual force pages for my custom object Request_for_System_Change__c.
There is a Yes/No picklist called Request_Priority__c
When this is Yes I want to show the field Reason_for_High_priority__c
so the user can explain why the request is high priority.
Here below is the code:
<apex:inputField value="{!Request_for_System_Change__c.Request_Priority__c }">
<apex:actionSupport event="onchange" rerender="MyPanel"/>
</apex:inputField>
<apex:outputPanel id="MyPanel">
<apex:outputPanel rendered="{!IF(NOT(ISBLANK(Request_for_System_Change__c.Request_Priority__c))
&& ISPICKVALRequest_for_System_Change__c.Request_Priority__c, 'High'),true,false)}">
<apex:outputLabel value="reason for High Priority: "/>
<apex:inputField value="{!Request_for_System_Change__c.Reason_for_High_priority__c }"/>
</apex:outputPanel>
</apex:outputPanel>
But I am getting an error when saving:
Incorrect parameter type for function 'ISPICKVAL()'. Expected Picklist, received Text
so what am I doing wrong?
NOTE: I have taken the above code from the answer given by mast0r here
ISPICKVAL(Request_for_System_Change__c.Request_Priority__c, 'High')
(assuming that the fieldRequest_Priority__c
is a picklist field)Reason_for_High_Priority
to show regardless of the value in the picklist?