You need to sign in to do that
Don't have an account?
jucuzoglu
Render Component based on Date Comparison
I have two Date fields on an Object that represent Start and End Dates.
i would like to Render a component if it falls within the Start and End Dates. The following is an INCORRECT attempt to accomplish this.
<apex:outputPanel rendered="{!TODAY()>=Inbox_Assignment__c.StartDate__c &&
!TODAY()<= Inbox_Assignment__c.EndDate__c}">
Does someone know the proper syntax for this?
try a formula field of type boolean.
write your expression from the visualforce in the formula and it sets the boolean either true or false.
All Answers
try a formula field of type boolean.
write your expression from the visualforce in the formula and it sets the boolean either true or false.
Can you provide an example (or a URL to an example with a formula field similar to what your describing with the date?)
I feel like a big part of my problem is the syntax (not just how I am trying to evaluate the condition) and having an example would be a huge help.
You make a formula field of type number. (not boolean, that was wrong)
Lets call the field age__c
You insert your fields by clicking on insert field an choosing them.
it may look like this:
And in visualforce you write:
Try this.
Make a few records and watch the number which you get. maybe you need to replace the > with an <.
Take a boolean variable and use the if condition inside the gette of that variable and then use that Boolean variable to render your component.
Let me know in case you need an example.
I realized what I think you were saying, Do the Boolean evaluation in the controller and then that variable can be the driver for the rerender.
This worked for me (using a boolean).