+ Start a Discussion
Ralph PenceRalph Pence 

How to use true/false statements in visualforce email?

I'm working on a visualforce email template. I'm trying to display a textarea only if a certain checkbox is unchecked, but I keep getting the error: "Incorrect number of parameters for function 'IF()'. Expected 3, received 1"    

Here is my code:
<apex:outputText rendered="{!IF(cx.Activity_Completed__c == FALSE)}"><apex:param value="{!cx.Activity__c}" /></apex:outputText>
kaustav goswamikaustav goswami
Please try this
 
<apex:outputText rendered="{!IF(cx.Activity_Completed__c= FALSE,true,false)}">
    <apex:param value="{!cx.Activity__c}" />
</apex:outputText>

Thanks,
Kaustav
KaranrajKaranraj
Ralph,

You have to pass there parameters for the IF condition, try the below code
<apex:outputText rendered="{!IF(cx.Activity_Completed__c == FALSE,TRUE,FALSE)}"><apex:param value="{!cx.Activity__c}" /></apex:outputText>


 
Kris GreeneKris Greene
You can also just opt out of the IF formula stuff and do something like this if the field is actually a boolean, or just run the comparison and it'll resolve as a boolean.
<apex:outputText rendered="{!!Activity_Completed__c}">
<apex:param value="{!cx.Activity__c}" />
</apex:outputText>