- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 02:34 PM - edited 04-15-2024 02:37 PM
Hi,
I have requirements as below:
1. 'Expected Start Date' should be selected after 7 days from today (if not then show error message and clear the value)
2. 'Expected Completion Date' should be after 'Expected Start Date'. (if not then show error message and clear the value)
For the first requirement: I created a UI Policy which is working fine.
For the second requirement: I created a client script, which is getting Invalid Date from Start date in the script and not working.
Can anyone please help me fix the above issue.
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 09:58 PM
Hi @Nipan1 ,
For the second requirement also you can create a UI Policy and add the below condition.
date_2 should be "Expected Completion Date" and date should be "Expected Start Date".
Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me.
Regards,
Deborah Brown
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 11:13 PM
Hi @Deborah Brown L,
I appreciate the solution provided above. The UI policy is indeed effective for me. Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 10:28 PM
Hi please check example from below link
https://www.servicenow.com/community/developer-articles/date-validations-client-scripts/ta-p/2298860
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 11:11 PM
Hi Nipan,
Please follow the link mentioned below as it will be much easier way with no code solution
https://www.servicenow.com/community/developer-articles/no-code-date-validations-through-catalog-ui-...
Mark Helpful if resolves your problem
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2024 07:46 AM
No Code Date Validation
Try going the above page as it might help you with validating the date fields accurately, may be with no code even
Thanks,
Please mark the post as helpful if it resolves your issue