Could someone assist me in implementing a "Loading...
# suitescript
r
Could someone assist me in implementing a "Loading Please Wait" kind of pop-up for a suitelet? I need the suitelet to load completely, including the loading of the client script, before allowing user interaction.
e
What trigger are you using to know that everything has loaded?
r
I think in Netsuite, pageInit entry point gets triggered when a Record or Suitelet page loading completes. We can use that entry point function to know that necessary data has been loaded.
e
That's correct. So the
pageInit
fires when loading is complete, but you can't display your "Please Wait" message until it fires, so the page will already be complete. On a Suitelet, I'm not sure this makes sense because the page is already loaded, unless your
pageInit
is doing a whole bunch of other work; in that case, you could maybe offload much of that work to the server-side execution of the Suitelet instead. On a Record, this might make sense if your Client Script is guaranteed to be the first one to fire, but then you'd also need to add another script that closes the message after all other `pageInit`s have run. Seems messy.
r
I'm currently facing an issue where, as soon as the Suitelet loads the user changes the field value of a field with some logic in the fieldChanged. Due to this, the fieldChanged event doesn't trigger because the Suitelet is still loading and the client script hasn't fully loaded yet. So I think letting the user wait for a few seconds before client script loads completely can solve this issue.
e
I don't disagree that masking with a loading dialog would work, but if the problem is that the Client Script hasn't loaded yet, then why would
pageInit
execute?
r
Disable every button and field in the suitelet. Enable them through pageInIt.