How can I have a UE script run on work order close...
# suitescript
a
How can I have a UE script run on work order close?
u
The easy way to do it will be to check the oldValue and newValue of the WorkOrder status. condition will be like
if(oldStatus != newStatus && newStatus == 'closed'){ // your code;}
d
I'm not sure that pressing Close button triggers the UserEvent script (but might be wrong). What I used, is hiding the original Close button and adding a custom one.
u
Yes we can do that and then well need to close the order ourself. But clicking the close button should trigger the UE as we are editing and saving the record behind the scene.
a
It is not triggering the after submit.
d
What about beforeSubmit?
r
i dont think aftersubmit will work on close, it not its functionality.