Date Cannot Be Future Dated

Seth3
Tera Contributor

Hi, I have a requirement asking that I create some sort of script that prevents a user from submitting catalog items in the portal if the date is submitted with a future date.

I've tried a UI policy with the relative condition, but the date is also required to be in a certain format (YYYY-MM-DD), and I cannot use a variable that will check the current time, so that makes UI policies moot.

I have also tried a client script to fetch todays date, add 1 and compare the user entered date to (todays date+1), but I can't seem to get that working. 

Any advice or tips? 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

UI policy condition should take care of the logged in user's date format and you need not worry on it.

Please share what UI policy you created with the conditions

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

UI policy condition should take care of the logged in user's date format and you need not worry on it.

Please share what UI policy you created with the conditions

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader