Can the validateLine function in a client script b...
# suitescript
a
Can the validateLine function in a client script be used in a synchronous way? I know it need to return true or false. I am trying to use sweetAlert2 to give a dialog confirm modal and if the user clicks "ok" that validateLine should return true otherwise false. The problem is the function is asynchronous and by the time user clicks his selection, the function has already finished running
m
I haven't found a reliable/supported way of using an asynchronous dialog (
N/ui/dialog
, etc.) with functions that return booleans like validateLine or saveRecord. I'd suggest just using window.confirm() - it's definitely worse-looking and you have less control over the buttons and whatnot, but it's synchronous so it works at least.
a
Okay. Thanks