When ServiceNow form loads, the on change script is acting

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 05:24 PM
Hi
We have an on change script which acts on date-time variable. It works fine for future date validation but once the form is submitted it takes to our custom ticket conversation widget and shows the error message that date is not valid. Also when view this ritm under 'My Requests' , it shows the error message written in the onchage client script.
Please advise me anyone has faced this issue?
I followed KB article from servicenow(https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1117925) which is for requested_for field and tried
if (isLoading || newValue == oldValue) return;
but it didn't work
Thanks
Bimsari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 10:40 PM
Hi @Community Alums Can you share your Client Script code?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 11:10 PM
Hi
below is the script, on change script and variable is
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 11:00 PM
Hi @Community Alums Please share the script also check if there is any conflicting script for the date-time variable

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 11:12 PM
Hi below is the script, I coudlnt find any scripts affecting this variable. It's strange that when I console.log it the new value becomes zero after submission
Hi
below is the script, on change script and variable is