0

Question

Given a value, how can I cleanly compare that it is not equal to a set of values in a visualforce formula?

Background

I'm building an email related list component driven by a field set. To improve the output I'm detecting the display type for some display types, but there are a bunch of other ones that I still just output raw text from. As I add additional type the rendered tag starts to get nasty, for example

rendered="{!field.type <> 'double' && field.type <> 'percent' && field.type <> 'currency'}"

Is there a way to do this without having to repeat field.type so much? Hypothetically it could be something like this:

rendered="{!NOT(('percent','double','currency') = field.type}"

2 Answers 2

2
{!NOT(REGEX(field.type,'percent|double|currency'))}
2

try CONTAINS

rendered="{!!CONTAINS('percent double currency', field.type)}"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .