Has anyone successfully got server side promises w...
# suitescript
r
Has anyone successfully got server side promises working? I have some logic that I need to execute when the previous logic has completely executed.
c
Call me old fashioned, but you can just execute line-by-line synchronously
👍 2
c
Would definitely need some more info on it.
r
Well there is a suitelet that makes adjustments on the customer record. Once the customer record has set certain fields I need to save the sales order which triggers the after submit function. I need to wait for the after submit function to complete before I execute the next set of logic.
n
I'm not sure how a promise would work with that? You're calling the save function and waiting for that to complete. Then NetSuite calls the after-submit functionality which is entirely separate to the suitelet save loop
what you would need is to have that after submit function execute whatever else you're doing separate from that Suitelet
b
you have not described a situation that Promises were meant to solve