Is it true that clicking the native "Close" button...
# suitescript
e
Is it true that clicking the native "Close" button on a Purchase Order doesn't trigger UE Scripts? I have a UE script with an afterSubmit function that just logs out the
context
parameter, but it doesn't log anything when I click the Close button. Can anyone confirm that this is true? / Suggest how to run a script when a Purchase Order is closed via that button?
a
can't answer your specifics but general approach I'd take here would be to replace the existing button, with your own custom close button on the form, have it mimic the original functionality and then also trigger a client script, to just do a record.load / record.save to trigger the existing UE?
e
Thanks @Anthony OConnor that seems to be the workaround most often suggested from what I've found. In my particular instance, since I don't technically need this to happen instantly... I'll just going to run a M/R script to find Closed POs, run the logic I need and then check some sort of "handled this closed PO" checkbox to prevent the PO from getting picked up again.
a
oh yeah that works too for sure 👍
e
On a similar note- the "Mark in Transit" button on Inbound Shipments doesn't trigger any UE scripts either. But to be fair, Inbound Shipment records in NetSuite are a very half baked product