Untitled.js
# suitescript
r
Untitled.js
@battk I updated my code. It still doesn't work if I tab. Also, it works the first time I click out of the field, but the second time it opens a dialog box 2-3 times.
b
your code is basically equivalent to your old code
doesnt do anything interesting with the Promise
first step is creating a variable to store when you have a dialog open
r
A variable... of... ? I've already stated I do not know how to interact with the promise state. Somehow I don't think x=2 is going to help the situation.
b
true or false
to represent if you have a dialog open or not
set it to true when you create the dialog
set it to false when its closed
you wont be able to directly access the Promise state
you will have to use the methods on the promise instead
r
I thought I entered the success function when the dialog box closed... When is it closed? lol I'm sorry, I understand none of it
b
you did
anything that triggers any of the Promise methods means the dialog closed
dialog.alerts aren't very complicated
which is why I recommended using the finally method, since you will end up doing the same thing no matter if there was an error or not
r
What you're saying doesn't square with what I'm seeing. success, failure and exit all happen before i close the dialog box.
b
that doesnt sound correct
the code you shared should display an alert
when you click the ok button, it should trigger the success callback function
and then the exit callback
you should not get all 3
certainly not all 3 before you do anything to the alert