How to restrict saturday and sunday using UI Policy when selecting the date field?(Only Business days should be selected)

Akhil42
Tera Contributor

How to restrict saturday and sunday using UI Policy when selecting the date field?(Only Business days should be selected)

1 ACCEPTED SOLUTION

I think you should mark this response as correct as that contains the script

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

View solution in original post

15 REPLIES 15

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can use onChange client script on that date field and check whether the selected date is saturday or sunday

or you can use onChange with GlideAjax

refer below link

Select Weekdays in the date field

Regards
Ankur

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

Hi Ankur

My task is like if we select start date,we cant select end date field more than after 3 days. it will throw an Error.

I achieved it through ui policy.

But if i selected start date as friday it should exclude the count for  saturday and sunday.

Hi,

then in Ajax do this

1) add 3 business days to start

2) check if this date is same as end date

Regards
Ankur

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

Hi 

Please,Could you provide some brief explanation