- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2022 10:46 PM
Hi,
I have a requirement where I need to display a confirm message when a user clicks on request approval UI Action.
The form should remain on the same page when user clicks CANCEL.
I've written a onSubmit Client Script.
This is the UI Action.
Issue is the form is moving to assess even after selecting CANCEL. Can anyone figure out what the exact issue is and suggest appropriate changes.
Thanks
Aditya
Solved! Go to Solution.
- Labels:
-
Multiple Versions
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2022 06:42 AM
The issue was solved.
In client script just set the state as new before returning false as OOB even if script was returning false the state changes to assess on form level.
As the UI Action was OOB I didn't wanted to change it but even that could have worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2022 10:54 PM
My guess is that your UI action does its thing and after that your onSubmit script is run, but it doesn't matter anymore.
Instead you could just add confirm to the beginning of your UI action and run the script if answer == true?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2022 11:21 PM
Hi,
As per your question you want to show confirmation when button is clicked then why not add script to show confirmation there.
Don't use onSubmit client script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2022 06:42 AM
The issue was solved.
In client script just set the state as new before returning false as OOB even if script was returning false the state changes to assess on form level.
As the UI Action was OOB I didn't wanted to change it but even that could have worked.