Hi all, I am going to show a popup message (like w...
# suitescript
n
Hi all, I am going to show a popup message (like warning or alert) inside a workflow action script. The workflow action script is executed by clicking a button which is created inside a workflow. I placed 'N/ui/message' code inside the workflow action script, but it doesn't seem to work. How can we do this?
b
Go through Workflow Triggers so you can recognize where custom actions run
1
n
This is not same case. The problem is the popup should be inside Workflow action Script.
b
is your custom action a server trigger or a client trigger
n
The custom action calls workflow actions script.
b
you will want to understand where your script is running , on the server or on the client
that information is related to the trigger
n
The script copies current Sales Order, so we can say it is running on server.
b
it running on the server, but literally because custom actions only have server triggers
its unrelated to what your script does
N/ui/message is for use in the client, there is nobody to view your messages on the server
n
Yeah, I know it. So I posted the problem in the suitescript channel.
You say it is impossible?
b
there are different options available to you depending on the trigger
you arent going to be able to go much futher without understanding the different triggers
n
Let me explain in detail. SO form has a custom button and when click the button, it copies the SO to create a new SO. At this time, if any item lines are not copied (by a condition), I have to show a popup.
I am building this logic by a workflow. How can I show the popup?
b
using the show message action typically requires a state transition or at the very least a field to use in a condition
n
There is a line column (checkbox) in item sublist of SO. Can we check if all items are not checked in the column in workflow?
b
workflow conditions generally dont work with sublists
and saved search conditions dont do summaries
so the workflow by itself cant
though you can use a workflow action script to set a relevant field, which workflows can use
n
Suppose the workflow action script set a relevant field. But how to let the workflow know it should show popup?
b
use a condition on the show message action
n
but the problem is show message action should work when button is clicked
b
not an option, the button only triggers a transition
you show the popup afterwards
n
I am not sure if it works yet. Anyway thanks for your time for this.