Is it possible to render a VF page based on two booleans?

Can you have something like:

<apex:page rendered="{!relatedTo.boolean1 == true}&&{!relatedTo.boolean2 == true}">

Or should I create a formula field on the object that takes the conditions I want to check for and return one true/false result?


Yes you can. Based on your example, here's the right code:

<apex:page rendered="{!AND(relatedTo.boolean1, relatedTo.boolean2)}">

You can combine them both in the same merge field:

<apex:page rendered="{!relatedTo.boolean1 == true && relatedTo.boolean2 == true}">

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.