Service catalog Date & Time variable

Vinu1
Tera Expert

Hi All,

I have a requirement in the catalog item. Date & time variable should allow only 8x5 days and time should be between 9 am to 4 pm. If not it should display alert message.

Please let me know how to achieve this.

Thanks in advance,

Vinu

2 REPLIES 2

bammar
Kilo Sage
Kilo Sage

You need to go for a client script on change for the field. Not sure what 8 x 5 days means - but there are scripts where you can validate the day of week (0-6) and then hour of day (i beleive 0-23) you would evaluate the inputs on change and then show a message if they were outside the bounds.  

ALso put in field messages that always show next to the field explaining the dates and times you expect.

 

I just looked around now and other ServiceNow Geniuses have weighed in on this using no code

https://community.servicenow.com/community?id=community_article&sys_id=f61964aadbcb3fc85129a851ca9619eb

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Vinu,

you need to use onChange catalog client script with GlideAjax

In the GlideAjax function you can validate the date/time using schedule

Regards
Ankur

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