Has anyone figure out a clever way to monitor for ...
# suitescript
d
Has anyone figure out a clever way to monitor for a 'Close' of a transaction? Ideally realtime (but I know the struggles around monitoring Close).
b
Can you not create an AfterSubmit event on Edit, Xedit and check the oldRecord.status vs. newRecord.status and if different and newRecord.status = closed?
d
No. And Workflow is no good. So, best I can figure out is a beforeLoad that checks the status. (I'm concerned about what happens if an integration comes in a closes a transaction server side)
b
This is a user event script. This is how i do it and it works perfectly. And yes, if an integration or any other process closes a transaction you will know.
d
Wait, how did you do it? AfterSubmit edit/xedit? with comparing to the old value? Meaning ... if newRecord.status = closed && oldRecord.status != closed ... then the transactions was, at this moment, closed? That works?
b
Yes
d
@bversiga, clicking the 'Close' button in the UI does NOT trigger any UE events.