Is it possible to call a Client Script from a Work...
# suitescript
s
Is it possible to call a Client Script from a Workflow Action Script?
s
Except for weird cases where client scripts can be exercised serverside, no.
However, a common practice here would be to refactor whatever logic you need from the client script into a shared library.
s
Thank you! I have a client script that’s wired-up to a user event button. When I click the button the client script throws a nice dialogue box and then handles the click events. For sake of simplicity, I would like to make this client script logic accessible via workflow action button, so power users can call this at will. If I create a custom module/library and include the client logic, I can load the library path inside the workflow action script, and call the functions from that library to react client side?
s
Yes to everything except that last bit, I think. In other words I'm not sure you can't, but don't think you will be able to popup client UI things as part of a workflow
I think those scripts run as server-side scripts
👍 2
feel free to give it a try and report back
s
You're correct -I was unable to get an 'alert()' to fire client side from the custom module. Anything else you can think of that would allow me to call my client script from the workflow action script so that I can get the ui pop-us to display?
s
I don't know of any interaction between workflows and the UI in terms of script, but others may. One approach may be to translate the workflow into script and have a pure scripting solution?
s
10-4; Thank you Shawn!
l
how about using, clientScriptModulePath or the url.resolveScript?