Users should not be able to enter a date that is more than one year in the future.

kevin246her
Giga Contributor

Hi,

 

I need to restrict users from entering a date more than one year in advance. If they do, an error message should be displayed, and they should not be able to save the form. I've tried creating an on-submit client script, but it's not working. Can anyone suggest a solution?

 

Thanks in advance.

5 REPLIES 5

Pratiksha Lang1
Kilo Sage

@kevin246her 

Simply create UI policy, no need of so much scripting. I have created a UI policy on change request table on planned_end_date field for you reference. give condition as below: 

I have given relative after 365 days from now in condition. here in condition instead of 365 days, you can give after 1 years from now and it will be more accurate as it will consider the leap year as well.

 

PratikshaLang1_0-1717158152649.png

 

PratikshaLang1_1-1717158288693.png

 

 

Please mark my answer as helpful if it has helped you 🙂