Wait for one/many promesses to be fulfilled
While continuing my SuiteScript training, I noticed that there is no way to “wait” for one/many promises to be fulfilled.
How could I wait for the result of “doSomething()” before returning true or false ?
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.
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 (useto ignore client script while doing so)