Service Desk Practitioners Forum
cancel

Validating that a date is greater than now in UI Rule

SOLVED
Go to solution
Highlighted
David Borojevic
Outstanding Contributor.

Validating that a date is greater than now in UI Rule

Hi there,

4.5 sp15.

I would like to have a UI rule validate a custom date field. I want he condition to be if the Date is equal to or less than now then I want to fire the UI rule. I want to prevent someone putting a date in the past in this custom date field. However the UI rules only allow an actual day or a field. You can't select a function like current date.

Is there a way to do this?

Cheers
2 REPLIES
Akies
Outstanding Contributor.
Solution

Re: Validating that a date is greater than now in UI Rule

Hi David,

Try to define another date field capturing current date.
Now when your field gets put a condition of "Date 1 is on or after Date2".. then generate a prompt.

Tell me is this solution worth for u?

Regards,
Akhil
David Borojevic
Outstanding Contributor.

Re: Validating that a date is greater than now in UI Rule

Thanks heaps. That worked.

I had to create 2 rules.

First rule set to fire before the WorkOrder is saved - and set a custom date field I called "Current Date for Validation".

Second (subsequent rule) used the Date value in the custom field to compare and provide an error.

It is a pity functions are not directly available for this. This was important because I have a business rule that (if a "Re-open" flag is set) schedules the work order to re-open using the date - so the date needs to be in the future! I now have a recurring work order process for regular (daily, weekly, monthly or quarterly) maintenance tasks.

Cheers