Call a SuiteLet from a User Event Script, then display confirmation message


I  need to call a suiteLet from a UserEventScript (in after commit function). After a long period of search, try and error, I could manage to do it like that (sample of code) :

Call a SuiteLet from a User Event Script, then display confirmation message

As expected, in the afterSubmit event, the suitelet is called, then the user is redirected to the original record.

BUT : there is one side effect, because the user was redirected (even if it is invisible for him), he does not have any confirmation message !

Call a SuiteLet from a User Event Script, then display confirmation message

Users are used to the message. Having no confirmation seems like the record was not successfully created.

SO :

  1. Is the “redirect.toSuitelet” then “redirect.toRecord” method a good solution ? If not, how could I do it differently ?
  2. How could I display a message after the redirection ?


Thanks in advance 🙂 ,



Rookie Asked on December 5, 2019 in SuiteCloud.
Add Comment
3 Answer(s)
  1. what are you doing in the suitelet that you can not do in your aftersubmit user event?
  2. you could pass a parameter that another script is looking for and then post a message. just seems like a lot of unnessary scripting.
Rookie Answered on December 5, 2019.


Thanks for your answer. I am trying to trigger an userscript event (afterSubmit on Vendor Bill). I cannot do that in the first afterSubmit event.

For your other suggestion, could you give me more details ?




on December 5, 2019.
  1. so you are making an aftersubmit user event that should trigger a suitelet to trigger another userevent? why not move the code from the 2. user event to the first?
  2. you can have an onload script (the one displaying the message) listning for a specific url parameter that you are passing from your suitlet.
on December 10, 2019.
Add Comment

You can pass a parameter on the querystring when you redirect to the Suitelet and check for that to decide what message to display to the user via a client script.

Beginner Answered on December 5, 2019.
Add Comment

When trying to trigger a User Event from another User Event, the Suitelet in the middle strategy is a very common one, so you’re on the right path. However, you don’t need to *redirect* to the Suitelet unless the Suitelet has some sort of UI for the user to interact with. Instead, simply use the N/https module to send a POST request to the Suitelet from your original User Event.

On the other side, you can display the native confirmation method exactly as in your screenshot by using a beforeLoad event and calling the  showPageInitMessage on the Form object attached to the context parameter of the event handler. See the API docs in Help for how to use this function correctly.

Beginner Answered on December 10, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor   Become a Sponsor