it's 2024 has anyone found a nice solution for usi...
# suitescript
x
it's 2024 has anyone found a nice solution for using dialog.confirm within a client script saveRecord?
n
'Nice' solution. No. But what i've found is that you can submit the form through the script. so basically i always return false out of the save record, then in my promise object if they click 'ok' or whatever you have that says yes you can save this, then i get the form and submit it. Since the save record function executes all the code and ignores the promise this is the only way i've found to do it. Haven't had any luck adding an 'await' to the function or anything. I can grab some code snippets for you if you'd like, i just have to go find them.
1
x
something like document.forms[0].submit() right?
not so nice true and I was getting the annoying unsaved changes alert, which wasn't removed when doing window.beforeunload = null
n
Ok yeah i found the code.
Copy code
window.onbeforeunload = null;
document.getElementById('main_form').submit()
^^ that's just in my "then" statement for the promise function.
x
thereabouts 🙂 thanks I'll try it out too. I mean native alert ain't all that bad but ya know, dialog.confirm is much nicer
n
Oh i agree. I actually went a step further and imported SweetAlerts2 to use. Cause the popups are a lot nicer. and easier to customize
x
😎 very nice, thanks for the tip
🫡 1
e
But hey maybe SuiteWorld 2024 is going to be focused in this day to day enhancements and not in chasing the AI hype... right? ...guys?
😂 3
n
😶
x
I'm still waiting for the SPA trials which were promised 🤭
The real reason I go is for the Pickleball
j
Has anyone here ever used SweetAlert in TypeScript? You can't load it like you would a module in JS.
n
Currently having this same problem
j
Tried loading it with the file module using a Promise but no dice.
181 Views