- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2020 02:50 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2020 03:16 AM
Hi Chaithra,
Can you use below
g_form.setValue('select_an_end_date','');
g_form.showFieldMsg('select_an_end_date','Please select future date','error',true);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2020 03:41 AM
Did reproduce here and it's working 😞
Did you try .setValue('select_an_end_date', '') like I mentioned?
Can you also try:
g_form.showErrorBox('select_an_end_date', "Your message");
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2020 03:50 AM
only alert is working , I tried showFieldMsg, showErrorBox,infoMessage ,but not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2020 03:52 AM
Can you confirm you are using the correct variable name (select_an_end_date)?
If that is wrong then it wouldn't know where to show the error message.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2020 03:52 AM
Any other Client Scripts / UI Policies which might get triggered because of your clearValue? And causing a clearMessages perhaps? Can you check?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2020 04:07 AM
Sorry , i did not gave the condition in when to apply section. Now its working fine
Which one is best practices for the date validation using Ui policy or client script?
Thank you guys sooo much! This solved the issue!!!