Display Popup message with "Yes/No"

Geeky
Kilo Guru

Hi All,

How can I display a popup message for confirmation with Yes/No buttons? And then based on the response, perform the respective operations?

I do not want to use below client script as it shows OK/Cancel button, instead show the popup form to display Yes/No or any other information.

var answer = confirm("Do you want to proceed");
if (!answer)
{
return false;
}
6 REPLIES 6

Dubz
Mega Sage

You could try downloading Sweet Alert from servicenow share

https://community.servicenow.com/community?id=community_question&sys_id=c3d6cba5db1cdbc01dcaf3231f96...

Alternatively you can use a GlideDialogWindow to open a UI page where you can configure what you want users to see.

Omkar Mone
Mega Sage

Hi 

You can use something like this also in the client script - 

 

spModal.open({
title: 'Loading Modal',
message: "Testing the modal open from client script",
buttons: [
{label:'Ok', primary: true}
]
});

 

Hope this helps

 

Regards

Omkar Mone

I copied your code in client script but it is not displaying anything.

spModal is available only in service portal client scripts.