Issue with Submit Button Message Trigger in ServiceNow Order Guide

EricaT_
Mega Contributor

Hello,

 

I have an order guide that contains multiple service requests. I created a client script on the Submit button to display a message after the user submits the request. However, the message is being triggered when the user clicks the Next button instead of after actual submission.

 

Here is the client script. Can someone help?

 

EricaT__0-1779836764724.png

 

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron

@EricaT_ 

your onSubmit is on catalog item and hence when you click Next it shows the message

You want message when Order Guide is about to be submitted?

You will have to clone the OOTB widget, make changes to that new widget, then add that new widget in your page

Too much customization, I won't recommend

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

@EricaT_ 

it comes from this widget "SC Order Guide"

55.png

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Tanushree Maiti
Tera Patron

Hi @EricaT_ 

 

Option 1Create onSubmit script to the specific Catalog Item(s) within the Order Guide instead of writing it in order guide.

 

Option2: You can try with

  • Create an async or after , Insert BR on sc_req_item table.
  • Use gs.addInfoMessage()  to display the message to the user after the records are successfully inserted

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

Ankur Bawiskar
Tera Patron

@EricaT_ 

your onSubmit is on catalog item and hence when you click Next it shows the message

You want message when Order Guide is about to be submitted?

You will have to clone the OOTB widget, make changes to that new widget, then add that new widget in your page

Too much customization, I won't recommend

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

 

You are absolutely correct. I had to clone the widget and make changes to the HTML section. It was necessary to apply those changes, and it is now working perfectly.

 

I need to display a message when the user clicks the Previous button on the Choose Options screen, but I can’t find the Previous button name in the client controller script on breadcrumbs widget.  I could be looking at the wrong widget.  Could you help me?

 

EricaT__0-1779909111561.png

 

 

Thank you

@EricaT_ 

it comes from this widget "SC Order Guide"

55.png

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader