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
Hank RyanHank Ryan 

ISPICKVAL() isn't working in my visualforce page

I'm building a visualforce page to show some flags at the top of a contact record based on certain criteria.  I'm running into a problem with the following code:

 

 

<li style="{!IF(ISPICKVAL(contact.Prospect_Status__c, "Requested No Contact"), "", "display:none")}"><strong>They Have Requested No Contact:</strong> This person requested that we not contact them.</li>

 

 Every time I try to save this (using the built in VF page editor) I get an error that says "Error: Incorrect parameter for function ISPICKVAL(). Expected Picklist, received Text" and it won't let me save.  Am I losing it?  It seems like this should be easy.  BTW, yes Prospect_Status__c is indeed a picklist (single, not multi).

 

Thanks in advance!

 

Force2b_MikeForce2b_Mike

Honestly, I'm not sure. The syntax looks valid.

 

If you can wait another week or so the Summer '09 release adds the TEXT() function, so something like the following should work:

{!IF(TEXT(contact.Prospect_Status__c) = "Requested No Contact", "", "display:none")}

 

 Mike

Hank RyanHank Ryan
Thanks for the reply... good to know it doesn't make sense to someone else as well.  I just ended up going with a workaround that sets the visibility using javascript instead of salesforce merge fields.  But I'd rather do it without javascript, so it'd be nice to find a fix for this.  Maybe the new release will help, I'm starting to think it might just be a bug in the VF parser on the built in page editor.