I have a link that I want to display when Category = 'data1' AND Custom URL = 'data2'.

I know how to do this with only one condition, how can I do this with two conditions?

<apex:outputLink value="/page" styleClass="btn" id="register" rendered="{!IF(article.Custom_URL == '', TRUE, FALSE)}">Register</apex:outputLink>


This link does not work as expected, it requires Category__c = 'Events' and Custom_URL__c to be NOT BLANK. When the conditions are met the link is still not shown.

<apex:outputLink value="/page" styleClass="btn" id="register-special" rendered="{!IF(AND(article.Category__c == 'Events',article.Custom_URL__c != ''), TRUE, FALSE)}">Register</apex:outputLink>

You can use standard functions in the rendered statement

<apex:outputLink value="/page" styleClass="btn" id="register" rendered="{!IF(AND(Category__c == 'data1',article.Custom_URL == ''), TRUE, FALSE)}">Register</apex:outputLink>
| improve this answer | |
  • Could you check my update, the link does not display on certain conditions. – Deployment Failure Jan 26 '15 at 16:42
  • 1
    1. try ISBLANK() for the custom URL. 2. If still not working as expected output the values of the fields on the VF page to double check what they are. Maybe the data is not as you expect – Eric Jan 26 '15 at 16:54

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.