Field & Form Rules: How to check, if a date field is blank/not set?

Field & Form Rules: How to check, if a date field is blank/not set?

Hi Forum,

Am trying to do the following in a change template:

When the change is set to closed and the SCHEDULEDENDTIME is not set, set it to current date and time.

Got a "On Form Submit" rule with "On create/edit", condition "Status" is any of the "closed>>closed..." with the following script:


var x=$CS.getValue("SCHEDULEDENDTIME");

if(x === "") {
   $CS.setValue("SCHEDULEDENDTIME",new Date()); 

It doesn't work :-( Just setting the date without the IF works, but I only want to set it, if it's blank.


Thanks in advance,
Peter
                New to ADManager Plus?

                  New to ADSelfService Plus?