How to abort the action performed by the user for onChange client script

Ulka1
Tera Contributor

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.

18 REPLIES 18

Ulka1
Tera Contributor

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. 

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:

find_real_file.png

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

rameshonat
Tera Contributor

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.

Martin Ivanov
Giga Sage
Giga Sage

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