Is it possible to call a client script from Business Rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2016 04:41 AM
I run into a requirement where a server side action (a delete operation) needs to happen based upon confirmation from user. (A promp Box)
Is it possible to call a client script from a before delete business rule. And proceed based upon the user response on a prompt box.!?
* I have a related list of records in a custom form . Users can click Mark delete icon (highlighted). And then "Save" the form which in turn is deleting the record.But we now need a prompt box before deleting.
Any leads will be helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2016 04:44 AM
I would go the other way. I would create a UI Action that is a client called, that prompts the confirm box up and does a current.deleteRecord() or something like that. I don't think you can call both client and business rules in the same script outside of GlideAJAX.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2016 04:45 AM
Check below:-
How do i call client scripts after executing the business rule in a table?
Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.
Thanks,
Deepa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2016 04:45 AM
Prasanna,
What could be done is using the script include which also runs on the server side like the business rule.
in your case you can display a confirmation message and depending the user action, you can call the script include and achieve the task.
Here are two posts that explain how script include and client script interacts :
Script Includes - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2016 06:25 AM
But clicking the "Mark delete" cross in the related list isn't an action which can trigger a client script. So that i can glideajax to script include and return.