- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2021 09:45 AM
User needs to be restricted when user selects the past time in the date fields in the change form. Need to create BR / client script against The Planned Start and End times along with the Outage Start and End times. The business rule/ Client script should prevent all ITIL users from setting a date and time in the past based on their current system time.
I have created Below script include and client script. It is working on preventing user if he selects previous date. But I want to restrict user to select past time also. Please give me solution.
Script Include:
Client Script:
I have created OnChange Client Script on Planned Start date field as below.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2021 08:26 AM
Hello
Please use my below working Scripts, I have achieved this in my PDI. You only need to replace your variables.
onChange Catalog Client Script:-
1) Client Script for Future Date Validation:-
2) Past Date Validation:-
3) Common Client Callable Script Include:-
4) Script Include Code;-
Please Mark Correct and Helpful
Thanks and Regards
Gaurav Shirsat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2021 03:42 AM
Thanks for your response.
Actually I need time validation also. Please provide me solution on that.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2021 07:38 AM
Do you mean like a Date/Time comparison, or a separate Date and Time variable?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2021 08:22 PM
Hi Mark
i have 2 date variables on a catalog item, i need to compare them i.e.
end date should be greater than or equal to start date
i think you have mentioned in a previous article, its possible via a UI policy, if so can you provide a example please
Thanks
Levino

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2021 09:36 PM
Comparing two date/time variables is one of the examples in the article I mentioned. No scripting involved in that check.
Have you tried that?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2021 04:47 AM