- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 12:13 PM
Hi All,
We have two variables on the catalog form Start Date & End Date
Difference between the variables can not be greater than 3 months.
For Example: If Start Date is 17-Jan-2024 then the End Date (I.e.., 16-Apr-2024) should be less than 3 months
If the user enters after 16-Apr-2024 it should throw an error.
ISSUE: Date type variable returns the below value
Logs:
How can we achieve this using this format.
Thank you!!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 11:26 PM - edited 01-16-2024 11:27 PM
So have you looked into no code date validation at all? The article also contains an example of what you are after, only thing is the example is on hours, which you can just choose a different operator for.
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
01-16-2024 01:14 PM
Hi There,
You might need a script on your second date dropdown to calculate if the date is valid. Here is a sample script I developed.
**********************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 01:30 PM
Hi Joe,
Thanks for the reply!!
1. Created a On Change Catalog Client Script.
2. From the Catalog client script i am sending both start date and end date values
3. Now issue is its sending the data value in the below format.
Like alphabets Jan, Feb etc...
Type of the variable i am using:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 02:27 PM
On the client script for my Catalog Item, when I am using
And when my variable is Date/Time, it get this:
Could there be a system setting that is displaying your date is another format?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 02:45 PM
Hi Joe,
What is the Variable type of required_by?
Mine is Date not Date Time
Thank you !!