Hide cross mark on UI page and show the page at the top

Harish74
Tera Expert

Hi there,

I created a UI page that displays Yes/No button. Based on the user input selection the actions gonna take place. But the user is still able to close the UI page using the "cross mark" without selecting any input. That should not happen. 

find_real_file.png

Please help me in removing that "cross mark" and also I want to place this UI popup at the top of page instead of center.

 

1 ACCEPTED SOLUTION

Hi,

You can use this code and it would show the confirm box with Yes/No and it comes in center

var dialog = new GlideModal('glide_modal_confirm', true, 300);
dialog.setTitle('Confirmation');
dialog.setPreference('body', 'Is there a Cost impact?');
dialog.setPreference('focusTrap', true);
dialog.setPreference('onPromptComplete', doComplete);
dialog.setPreference('onPromptCancel', doCancel);
dialog.render();
	
function doComplete() {
	callback(true);
}
	
function doCancel() {
	callback(false);
}

Output:

find_real_file.png

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

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

View solution in original post

13 REPLIES 13

Community Alums
Not applicable

Hi Harish,

use the below code to remove it.

dialog.removeCloseDecoration();

replace the dialog with your dialog window object.

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Hi Sandeep,

Thanks it worked. Can you please help me in placing the popup at the top instead of center?

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

I would request you to discuss with your customer whether it should be actually removed or not.

I doubt you can add on center or not

Regards
Ankur

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

Hi Ankur,

Yes, I brought this to the customer they don't want to see the cross mark and they need the popup to be shown at the top like how an alert/confirm message displays at the top.

I thought of using the confirm message but with the confirm message we can't show Yes/No we can show ok/Cancel buttons.