add a popup message onSubmit on a record producer.

Jen11
Tera Expert

I have the following record producer which works fine.  I would like add a popup once clicked on submit something like 'Thank you for your submission'  please help on where and how i can add that.  

 

 

var notes = "Campus: " + producer.u_campus_incident.getDisplayValue();
notes += "\nEquipment ID/Printer Tag Number: " + producer.u_equipment_incident.getDisplayValue() + "\nSelect affected application: " + producer.Select_affected_application.getDisplayValue() + "\nPlease describe your issue below: " + producer.Please_describe_your_issue_below;
current.work_notes = notes;
var caller = gs.getUser();
current.type = 'self-service';

current.short_description = producer.short_description;

current.opened_for = producer.Requested_for;

 

thank you.

7 REPLIES 7

Elijah Aromola
Mega Sage

You could add an onSubmit script for this:

function onSubmit() {

   g_form.addInfoMessage("Submission successful!");

   // or you could do an alert on the browser
   alert("Submission successful!")
}

I added the above but it didn't work.  My original record producer, I didn't copy the entire thing, here is the entire record producer:  

 

var notes = "Campus: " + producer.u_campus_incident.getDisplayValue();
notes += "\nEquipment ID/Printer Tag Number: " + producer.u_equipment_incident.getDisplayValue() + "\nSelect affected application: " + producer.Select_affected_application.getDisplayValue() + "\nPlease describe your issue below: " + producer.Please_describe_your_issue_below;
current.work_notes = notes;
var caller = gs.getUser();
current.type = 'self-service';

current.short_description = producer.short_description;

current.opened_for = producer.Requested_for;


producer.portal_redirect = "mcp?id=memorial_index";
producer.url_redirect="home.do";

Hi there,

When exactly should the pop-up happen? Because your script also contains a redirect which onSubmit will execute? Or should the redirect wait a bit? And a user clicking the pop-up/alert/what ever and then redirect or something?

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

First the pop-up message and then the redirect.