Reply
Contributor
Anand - NPower
Posts: 9
0

Does IsChanged work for Date Field Types?

We are trying to create a Workflow Field Update that checks to see if a Date Value (Custom Field) has changed. We are using the IsChanged() function in Salesforce. For some reason it never evaluates to true. Any thoughts on what we are doing wrong? Or, does the IsChanged() function not work with dates?

In the example below, it should check the date field and update the IS_CHANGED__c field with a notification if the value has changed.

IF( ISCHANGED( My_Custom_Date__c ) ,'My Custom Date Changed on' & TEXT(NOW()) , IS_CHANGED__c )

Any thoughts or workarounds?


Super Contributor
Jakester
Posts: 1,063
0

Re: Does IsChanged work for Date Field Types?

I haven't tried IsChanged() on a date field, but I'm pretty sure that your formula needs some work regardless. For starters, text should be in double quotes, not single. Second, why are you putting IS_CHANGED__c as your "else" statement in the IF function? I'm not sure what that would do, but it may not be supported.

Have you tried just a simple
Code:
IF( ISCHANGED( My_Custom_Date__c ) ,"Changed","Not changed" )

 
to see if the basic idea works?

Contributor
Anand - NPower
Posts: 9
0

Re: Does IsChanged work for Date Field Types?

Thanks, that did the trick. I guess the single quote was the problem. Here is my revised formula:
IF( ISCHANGED( My_Custom_Date__c ) ,"My Custom Date Last Changed On " & TEXT(NOW()) , IS_CHANGED__c )
I am using the IS_Changed__c as the False condition so I can preserve the previous value if there is no change.
So, I guess this means that IsChanged() does indeed work fine for date fields.
Thanks for your help with this! -- Anand
Super Contributor
Jakester
Posts: 1,063
0

Re: Does IsChanged work for Date Field Types?

Cool! That's a neat trick using False to preserve the previous state, too.