Wait for one/many promesses to be fulfilled
Hey,
While continuing my SuiteScript training, I noticed that there is no way to “wait” for one/many promises to be fulfilled.
ex :
How could I wait for the result of “doSomething()” before returning true or false ?
I know how to do that in plain Javascript (use the await statement) but when I try to use it in my ClientScript, NetSuite tells me that there is an error in my file (at upload).
Any help would be nice 🙂 You can notice that I am very new to Netsuite so this might seems stupid, but I found nothing on SuiteAnswer that could answer my question.
Regards,
Loïc
I don’t think async/await would help you here. The function using validateField does not use async/await and would not wait.
Consider just returning false in doSomething. Then set the field back to whatever value was submitted, at the end of your promise chain (use to ignore client script while doing so)




