- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2019 04:53 PM
I have a Select box field "Typeofinterface_interface" were we have 2 choices :"New" & "replacement" for that and a Date Field :" lis_golive_date ."
When user select New in the choice , if the user enter date, Date cannot be less than 90 days from today it should not submit the value and show an error
if Replacement is selected in the select box ,if the user enter date ,Date cannot be less than 30 days from today, it should not submit the value and show an error.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2019 11:57 AM
Hi,
Make the golive date field mandatory and write a onchange client script on it.
You might have to write a script include to do the date validations. Here is the link whih could help you.
https://community.servicenow.com/community?id=community_question&sys_id=82fd87addb9cdbc01dcaf3231f9619cb
if(g_form.getValue("u_type_of_interface")=="new") {
//write our logic for data comparison of
}
} else if (g_form.getValue("u_type_of_interface")=="replacement") {
//write our logic for data comparison of
}
Kindly mark the answer as correct/helpful if this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2019 12:15 AM
Hi Kam,
Did you try the solution that i give you? I tried in my dev instance and it is working fine. Kindly check and mark the answer as correct, if it worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2022 06:52 PM
The code you provided is not working buddy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2019 11:25 PM
Hi,
Please refer: maybe you will find some interesting information
Thanks