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
{!NOT(REGEX(field.type,'percent|double|currency'))}
| improve this answer | |
2

try CONTAINS

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.