How to add pop up message to dispatcher workspace?

Parwani Priya
Tera Contributor

I am trying to create a pop up message in Dispatcher workspace to let the user know that the agent assigned is not from the correct group. I am currently making use of onChange client script in native view to display this information but the same is not working on dispatcher workspace.

The code written for the requirement is as follows:

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var assign = g_form.getReference('assignment_group').name;
g_form.setValue('u_assignment_name', assign);
if (g_form.getValue('u_wo_number.u_maintenance_team') != assign) {
g_form.addErrorMessage("Assignment group should match maintenance group");
var gm = new GlideModal("glide_warn", false, 600);
gm.setTitle("Error");
gm.setPreference("title", "Assignment group should match maintenance group");
gm.setPreference("warning", "false");
gm.render();

}
}

 

@Chuck Tomasi @Amit Gujarathi @Ankur Bawiskar 

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Parwani Priya 

GlideModal won't work in workspace

why not just show error message?

why to use UI page to show that?

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

The error messages are also not working on dispatcher workspace. I made use of onChange Client script to add error message in native view, but how to indicate wrong assignment to agent using workspace. 

@Parwani Priya 

can you share your onChange client script ?

Also did you try adding alert() and did it work fine in workspace?

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

Udayan Birajdar
ServiceNow Employee
ServiceNow Employee

@Parwani Priya  Adding a client script like this wouldn't work as client scripts are not recognized by the dispatcher workspace because its a worksapce built using UI Builder. You can however show a single notification instead of the modal using a capability in UI Builder. Please refer to this community article for more information https://www.servicenow.com/community/next-experience-articles/ui-builder-alert-messages-on-custom-pa...

 

Also if you need to add a modal you can configure that from the UI Builder experience of dispatcher workspace