I would like a popup with Yes / No / Cancel

Jerome MAISETTI
Mega Guru

Hello All

Can someone tell me if this is possible ?

I would like a popup with Yes/No/Cancel buttons, if yes is selected, does action 1, if no is selected, does action 2.
I searched a bit everywhere but doesn't find this.

Thanks

Jérôme

1 ACCEPTED SOLUTION

Jerome MAISETTI
Mega Guru

I managed to solve it 🙂

View solution in original post

7 REPLIES 7

Harshal Aditya
Mega Sage
Mega Sage

Hi @Jerome MAISETTI ,

 

Yes it's possible you need to create a UI page with the three buttons and you need to call the same in the client script.

 

You can use either GlideDialogWindow API or GlideModal API to call in a client script.

 

Please Mark My Response as Correct/Helpful based on Impact

Regards,
Harshal

 

 

AndersBGS
Tera Patron
Tera Patron

Hi @Jerome MAISETTI ,

 

Is it on a UI action you would like the popup? If yes, you can utilize following script:

 

function syncCIs() {
	var answer = confirm("IMPORTANT! by continueing all affectd CI's will be cleared from this outage record and updated with the affected CI's from the related task." + '\n\n' + "Do you want to continue?");

	if(answer == true) {
		gsftSubmit(null, g_form.getFormElement(), 'syncAffectedCIs');
	} else {
		return false;
	}
}

if(typeof window == 'undefined') {
    executeSyncCI();
}

This will create the following pupup:

 

AndersBGS_0-1679900557723.png

 

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

Hello Anders,
That I already manage, but now I need to have "Yes" , "No", "Cancel".
The goal is the following,
If the user clicks Yes, the update goes to External comments
If the user clicks No, the update goes to Internal comments
If the user clicks Cancel, nothing happens.

I have a UI Script where I tried to use some render, but it doesn't show up.


function alertme(e) {
//var customer = current.company;
var gm = new GlideModal("glide_ask_standard", false, 600);
gm.setTitle("External comment confirmation");
gm.setPreference("title", "Do you want this message to be pasted as External ?");
gm.setPreference("warning", "false");
gm.setPreference("onPromptComplete", function() {
alert("You clicked on 'Yes'");
});
gm.setPreference("onPromptCancel", function() {
alert("You clicked on 'No'");
});
gm.render();
var message = "Please ensure the recipients are correct. If YES, please press OK to send your mail. Press CANCEL to go back and adapt";
e.preventDefault();
if (confirm(message)) {
sendIfOkay(event);
} else {
console.log("Error");
}
}
addLoadEvent(manipulateEmailClient);