Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Custom popup box in Agent Workspace

Khalnayak
Kilo Sage

Hi Guys,

I have a client script for UI16 which displays a popup box to confirm an action.

I am using Glidemodal  for this and this works fine.

However, this doesnt work in Agent Workspace, so how can I create a custom modal popup in Agent Workspace that allows me to display a message with a a yes and no, and if yes trigger the rest of the script.
Thanks.

 

1 ACCEPTED SOLUTION

Pranesh072
Mega Sage

try g_modal.confirm in workspace client script 

 

var msg = getMessage("Are you sure you want to end this chat?");
	g_modal.confirm(getMessage("Confirmation"), msg, function (confirmed) {
		if (confirmed) {
			g_form.setValue('state', 'closed_complete');
			g_form.save();
		}
	});
	
	return false;

 

find_real_file.png

View solution in original post

8 REPLIES 8

Pranesh072
Mega Sage

try g_modal.confirm in workspace client script 

 

var msg = getMessage("Are you sure you want to end this chat?");
	g_modal.confirm(getMessage("Confirmation"), msg, function (confirmed) {
		if (confirmed) {
			g_form.setValue('state', 'closed_complete');
			g_form.save();
		}
	});
	
	return false;

 

find_real_file.png

Thanks Pranesh that worked!

Hi, This works and it shows the Confirm screen.

But it doesn't wait for the user to select OK or Cancel.

It simply shows pop-up and proceeds with next statement.

Pls suggest.

 

Thanks.

Vijayalakshmi

Can you share your code