Restrict user to add Time upto 24 hours only from selected date

Anu2013
Tera Contributor

Hi 

How to restrict user to update time only 24 hours from selection Date

Anu2013_0-1721969170756.png

 



Thanks In advance!

1 ACCEPTED SOLUTION

OlaN
Giga Sage
Giga Sage

Hi,

You can create an UI policy that checks if the start date and end date are less than 24 hours apart.

 

Selection of dates that differ more will still be possible, but the UI policy can, for example, clear the end date and inform the user to select another date if the date selected is invalid.

 

Be adviced that UI policies only work on the work on the form, if you need to validate this on backend, you'll need to combine it with either a data policy or a business rule that checks the values entered.

View solution in original post

2 REPLIES 2

SN_Learn
Kilo Patron
Kilo Patron

Hi @Anu2013 ,

 

Please check the below article:

No Code date validations through (Catalog) UI Policies 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

OlaN
Giga Sage
Giga Sage

Hi,

You can create an UI policy that checks if the start date and end date are less than 24 hours apart.

 

Selection of dates that differ more will still be possible, but the UI policy can, for example, clear the end date and inform the user to select another date if the date selected is invalid.

 

Be adviced that UI policies only work on the work on the form, if you need to validate this on backend, you'll need to combine it with either a data policy or a business rule that checks the values entered.