I have a suitelet with a client script and I’d lik...
# suitescript
c
I have a suitelet with a client script and I’d like to fire a
N/ui/message
with a success ribbon at the top. What’s is the standard way of passing a message from a suitelet post event back to a client script? I tried using a url parameter but that’s not a good way to get it done b/c reloading the page will re-display the message.
s
Pretty easy to read a param in the url in the pageInit of the client. EDIT I guess it does not really solve your reload issue.
Copy code
var url = window.location.href;
        if (url.indexOf('success') > 0) {
            var successMessage = message.create({
                type: message.Type.CONFIRMATION,
                title: 'Success',
                message: 'Words words words',
                duration: 1000000
            });
            successMessage.show({ duration: 1000000 });
        }
c
Yea, almost have to store it on a record somewhere.
s
In every scenario I've needed this functionality, the suitelet is triggering some task to fire off. That task ID is stored in some record somewhere, and script the task fired clears it out to indicate the task is finished. I assume your suitelet is doing something similar else there would be no need for the confirmation? If you do it this way, then the confirmation message can be handled by something stored on the page of the suitelet?
c
In my case I’m making an https call to verify something, I want to display the response back to the user when the suitelet reloads. It’s a throwaway response (not really worth keeping) but I suspect I’m gonna have to save it if I wanna display it.