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?

2 Answers 2


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}">

You must log in to answer this question.

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