0

i am trying to collor rows in an apex:column according to a date condition,

i am missing something in the syntax,

i am getting this error: " Syntax error. Missing ')' "

can't find the problem..

here is my code:

<apex:page controller="FlightsListController" >
    <apex:form >
        <apex:pageBlock title="Flights Gant" id="flights_gant">

            <apex:pageBlockTable value="{! flights}" var="flight"> 
           <apex:column value="{! flight.Time_of_Arrival}"  
                         style="{!IF( flight.Time_of_Arrival==Date(2017,10,25 04:04), 'background-color:blue;',
                                    'background-color:green;')}"/>       
            <apex:column value="{! flight.Flight_Number__c }" />
            <apex:column value="{! flight.Suitcases__c }"/>
            </apex:pageBlockTable>      
        </apex:pageBlock>
    </apex:form>
</apex:page>

1 Answer 1

0

You are using datetime value in Date format Date(2017,10,2504:04) Please use this DATETIMEVALUE('2017-10-25 06:40:00') Hope it will help you.

8
  • so now the syntax is ok but the color didn't change. any idea why? see link: img42.com/3xooA
    – maor.v
    Commented Oct 25, 2017 at 6:58
  • Please check your exact time via SOQL query and add them. it's also happen with me. Commented Oct 25, 2017 at 7:03
  • 2017-10-31T20:50:00.000Z - this is the format returned from my query, so what is my mistake in the syntax?
    – maor.v
    Commented Oct 25, 2017 at 7:14
  • DATETIMEVALUE('2017-10-31 20:50:00') add this, hope it will success Commented Oct 25, 2017 at 7:22
  • it works with this date but not with other dates. weird.
    – maor.v
    Commented Oct 25, 2017 at 7:29

You must log in to answer this question.

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