I want to set the background color for one column if the "Due Date" is older than today. I can't quite figure out the correct syntax for the variable that holds the date value for today.

I am currently getting this error: Incorrect parameter type for function 'not()'. Expected Boolean, received Date

VisualForce Page Snip:

                <apex:column style="{!if(acc.Due_Date__c <= !dToday,'background:#BDB76B;', '')}">
                    <apex:facet name="header">
                        Due Date
                    <apex:outputField value="{!Acc.Due_Date__c}" />

Controller Snip:

public class controller_AccountServicing {
    //Create Variables
    list    <Account_Servicing_Activity__c> accActivities   = new list<Account_Servicing_Activity__c>();
    public  boolean renderPrompt    {get;set;}
    public  Id      accId           {get;set;}
    public  String  accStatus       {get;set;}
    public  String  accExReason     {get;set;}
    public  Date    dToday          {get;set;}
    Account_Servicing_Activity__c   accToUpdate;

    public controller_AccountServicing(){
        //Initilization items
        Id currentuser = system.UserInfo.getUserId();
        dtoday = system.today();

1 Answer 1


I think you want to change this line

{!if(acc.Due_Date__c <= !dToday,'background:#BDB76B;', '')}


{!if(acc.Due_Date__c <= dToday,'background:#BDB76B;', '')}
  • @MattM - Could also use TODAY() in lieu of dToday in the VF expression
    – cropredy
    Commented Mar 28, 2018 at 19:04

You must log in to answer this question.

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