0

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:facet>
                    <apex:outputField value="{!Acc.Due_Date__c}" />
                </apex:column>

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

3

I think you want to change this line

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

To

{!if(acc.Due_Date__c <= dToday,'background:#BDB76B;', '')}
1
  • @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 .