- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 10:55 PM
Hi,
I want to get the UI Action name from the business rules when the users click on any UI Action on the table form like g_form.getActionName() at client scripts. How can I do that ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 03:40 AM
I will mark this answer as an "Accept as solution" because I have found an way to resolve this. For keyboard shortcuts saving the record I just create an business rules to detect the changes and for the UI Action, it needs clicking to process the script so I've put an constraint check if the fields which are inputted by users are not correct it will not run current.update() at the UI Action. With that I won't have to check if the button "Save" is clicked or not at business rules because solving this as an client script is easier than at business script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 11:40 PM
@sieusaopolo15 Create the ui action like this below, this will not be bypassed when users use keyboard shortcuts to save record.
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 11:14 PM
so what exactly you want to do when state changes?
write the same code in the BR
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 11:21 PM
I want to abort action when user triggers events save from keyboard shortcut and I don't want it to run when UI Action "Save" is clicked because inside of that action has current.update() which can trigger the business rules.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 11:31 PM
very difficult to identify if user is saving it using some keyboard shortcuts
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 03:40 AM
I will mark this answer as an "Accept as solution" because I have found an way to resolve this. For keyboard shortcuts saving the record I just create an business rules to detect the changes and for the UI Action, it needs clicking to process the script so I've put an constraint check if the fields which are inputted by users are not correct it will not run current.update() at the UI Action. With that I won't have to check if the button "Save" is clicked or not at business rules because solving this as an client script is easier than at business script.