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.

Glidewindow catalog client script Onload not working on service portal

Piyush291
Tera Contributor

hi All,

I have created a catalog client script on Load using glidewindow. When i tested on Portal it is triggering the Java console error. Kindly help

function onLoad() {

var dialog = new GlideDialogWindow('EAP_popup');
dialog.setTitle(new GwtMessage().getMessage('Confirmation'));
dialog.setSize(750,1000); 
dialog.removeCloseDecoration(); //Remove the dialog close icon
dialog.setPreference('cancel_url', '/google.com');
dialog.render();
}

16 REPLIES 16

AbhishekGardade
Giga Sage

Hello  Makk,

The way to do popups in Service Portal is with a Modal. You can find more information about spModal here.

 

Please mark as Correct Answer and Helpful, if applicable.

reference links:

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

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

Solutiion :

https://serviceportal.io/modal-windows-service-portal/

GlideDialogWindow is not supported in service portal.

Thanks!
Abhishek Gardade
Hexaware Technologies

 

 

Thank you,
Abhishek Gardade

Omkar Mone
Mega Sage

Hi 

It won't work on portal because you are calling a Ui Macro or something related to jelly scripting that is not supported on portal. You can make use of Macro Variable instead in which you can add a ui macro as well as widget which will work on portal. If it is just a pop up with button you can use sp modal as well. Check below - 

function onChange(control, oldValue, newValue, isLoading) {
	if (isLoading || newValue == '') {
		return;
	}
	var html = "Search Results.";
	// Use spModal to pop the HTML
	if (html) {
		spModal.open({
			title: 'Possible search results: ' + newValue,
			message: html,
			buttons: [
				{label:'OK', primary: true}
			],
		});
	}
}

 

Regards,

Omkar Mone

 

 

I have created a UI page for this and called in a client script.

Hi 

Yes that's right, UI Page uses Jelly scripting which will not work on Service Portal.