Add time limit on Expected delivery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2025 08:50 PM
Requirement:
Add time limit for expected delivery based on user's selection of drop-down[Delivery Type: Normal Delivery - 5 days, Express Delivery - 3 days, Express Delivery - 2 days and Express Delivery - 1 day].
In form we have below 2 variables,
1. Delivery Type[Select Box] - In this we have 4 options[Normal Delivery - 5 days, Express Delivery - 3 days, Express Delivery - 2 days and Express Delivery - 1 day].
2. Express delivery[Date/Time].
So here, when we select "Delivery Type" the "Expected delivery" field will auto-populate the date/time.
For example:
User/Me trying to submit the request on 19/06/2025 and the user/me select the "Delivery Type: Normal Delivery - 5 days", in "Expected delivery - we need to auto-populate the date/time is 25/06/2025".
Note: The Expected delivery will populate based on "Delivery Type", if it 5days,3days,2days and 1day - means we need to calculate the date - based on user's[means Singapore user's] selection from date of ticket submission, and in this we need to exclude Singapore public holidays, Saturdays and Sundays and if public holiday falls on weekends, then the following "Monday" is off day.
Thanks,
Jyothi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2025 09:02 PM
for this you can use onChange client script+ GlideAjax
1) get the logged in user location, that will tell you which schedule to use
2) then add those business days using schedule to get the final date, then return that date and set it in variable
check this link on how to add business days
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2025 10:11 PM
Hi @Ankur Bawiskar,
Thank you for quick response, the logged in user location is "Asia/Singapore". Could you please provide the exact onChange client script + GlideAjax,this will help full for me.
Thanks,
Jyothi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2025 10:15 PM
I already shared the approach
1) use GlideAjax, pass the delivery type drop down value (5, 10 days etc)
2) in script include function check logged in user location, get the schedule
3) how to add days, I already shared link above.
Unless you start you won't learn
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2025 10:59 PM
Hi @Ankur Bawiskar,
Script Include:
Catalog Client script:
This is not working, and it is going else part and showing the below alert,
Thanks,
Jyothi