Hey all, another random question. For Suitescript...
# suitescript
m
Hey all, another random question. For Suitescript 2.X scripts, Netsuite seems to block the uploading of any script with the words 'async function'. I understand server side, there may not be any capability to run an async function, but it is pretty useful client side. Does anybody know of a simple way to get around this? Thanks.
m
@battk Thanks! Apparently tagging it NApiVerison 2.X wasn't doing the trick. Gotta be 2.1.
b
mostly a failure in semantic versioning
2.1 introduced incompatibilities with suitescript 2.0 and they didnt upgrade the version to 3.0
👍 1
s
I really don’t like the 2.x/2.X version identifiers, since it doesn’t tell anyone looking at the code what the intended execute API will be, and can cause confusion.
👍 1
m
Actually @battk @scottvonduhn, if you don't mind, I have one additional question since you guys tend to be very experienced in this sort of stuff. Consider the client script default function saveRecord() that triggers when you save a record. It seems to be completely synchronous. Is it possible to get it to run asynchronously (so I can use a nicer looking alert library other than window.alert())
b
no, workaround are the ugliness of making the popup save the record again
m
@battk Is there an officially supported method for doing that? Or is the only real option there essentially DOM hacking?
b
fairly minimal, select the save button, press it
m
Makes sense, though I still wish there was a more officially-supported way to accomplish that - either a function to re-call the save, or, better yet, the option to return a promise in
saveRecord
. It feels like such a waste to not be able to use the
N/ui/dialog
functions in
saveRecord
without something unsupported.
m
I'll be honest... I kinda wish they would allow promise returns for all of the functions. Though I'm sure some of the validates have to be synchronous, so that wouldn't quite work there 😕.