Service catalog Date & Time variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2022 04:31 AM
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
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2022 09:28 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2022 09:06 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader