- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2019 08:19 AM
Hi Experts,
Is there any way to validate start date to ensure it is not in future on client side, i don't want to make a GlideAjax Call for this?
TIA
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2019 08:20 AM
Hi,
You can use a ui policy with condition as shown below:
In the script part you just have to throw the error on the start date like below:
g_form.setValue('start_date', '');
g_form.showFieldMsg('start_date','Start Date cannot be in future','error');
PS: Make sure you have the same field name as I have used.
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2019 08:20 AM
Hi,
You can use a ui policy with condition as shown below:
In the script part you just have to throw the error on the start date like below:
g_form.setValue('start_date', '');
g_form.showFieldMsg('start_date','Start Date cannot be in future','error');
PS: Make sure you have the same field name as I have used.
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 05:35 AM
Hey Anurag,
I wanted to let you know that this method doesn't work on a custom workspace.
Thanks,
Gonzalo

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2019 08:26 AM
Hi there,
Why client script? Why not no code?
Have a look at this article I wrote a while ago:
No Code date validations thru (Catalog) UI Policies
Again, no code.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field