You need to sign in to do that
Don't have an account?
Ludivine
rendered null date
Dear all,
I want to display a date field on my contract page only when this date is not null.
But something is wrong in the rendered statement, It displays an error message instead of nothing when the date is null :
Content cannot be displayed : The value "null" is not valid for operator '<='
My Visualforce page :
<apex:page sidebar="false" standardController="Contract" rendered="{!AND(contract.Reminder_Date__c<=today(),contract.Contract_Extension_Date__c<=null)}">
<font color="#595959" size="2"> <b>Contract Extension date</b> </font>
<apex:outputfield value="{!contract.Contract_Extension_Date__c}" />
</apex:page>
Any ideas?
Thanks,
Ludivine
I want to display a date field on my contract page only when this date is not null.
But something is wrong in the rendered statement, It displays an error message instead of nothing when the date is null :
Content cannot be displayed : The value "null" is not valid for operator '<='
My Visualforce page :
<apex:page sidebar="false" standardController="Contract" rendered="{!AND(contract.Reminder_Date__c<=today(),contract.Contract_Extension_Date__c<=null)}">
<font color="#595959" size="2"> <b>Contract Extension date</b> </font>
<apex:outputfield value="{!contract.Contract_Extension_Date__c}" />
</apex:page>
Any ideas?
Thanks,
Ludivine
Please mark asnser as solution if it resolve your issue.
All Answers
To compare the value with null you can write like :
rendered="{!IF(ISNULL(contract.Contract_Extension_Date__c),true,false)}"
Please refer to posts:
https://developer.salesforce.com/forums/ForumsMain?id=906F000000097R5IAI
https://developer.salesforce.com/forums/ForumsMain?id=906F000000097JiIAI
Thanks,
Pratik
P.S. If this answers you question, please mark it as "Best Answer" so it will help other community members too.
Please mark asnser as solution if it resolve your issue.