How to abort the action performed by the user for onChange client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 10:50 PM
Hi,
I need to abort an action performed by the user by using onChnage client script.
Please could anyone help me to get it done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2022 12:19 AM
Yes, it is very strange. I am working on it last few days and tried all possible solution but not getting the expected result.
1. By using onChange client script with script include, it works finely but when we end the impersonation (from the assign to user login) and reload the form then the case state value changes to "Resolved", which should not happen.
2. By using the Br which you just mentioned action is getting abort but error message is not getting displayed on the screen.
So, for this requirement getting struggle to implement it for the expected result.
Could you please help me if if found any way to solve.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 11:18 PM
Just Replace Child table Name as "sn_hr_core_task" in Script above and you should be good there with your requirement.
Sharing screenshot as well:
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2022 12:52 AM
There are 2 options
1. Don't show UI action 'Resolve Case' if there are open tasks
(OR)
2. In the UI action itself, make it client based action, check for open tasks, if exists show error message else submit
Mark my answer correct & Helpful, if Applicable.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2022 12:21 PM
Hi. If your issue is resolved and my response has helped, plese consider marking Correct and Helpful. Thanks!
Martin Ivanov
2022 Community Rising Star
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024