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.

Remove close declaration on UI Page

Community Alums
Not applicable

I'm struggling with this one, I have a UI Page which is triggered from a client script which works a treat however I'm trying to remove the close declaration from the header but cant seem to get it to work.

I've tried, Solved: Re: Remove the Close X on Glide Dialog window / UI... - ServiceNow Community however I just get an error message stating its not a function.

Any help would be greatly appreciated. 

Andrew_TND_0-1737544875912.png

 

 

// On change client script

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
	var active = g_form.getValue("u_active");
    if (active == "false") {
        var dialog = new GlideModal('UI_PAGE');
        dialog.setSize('wide');
        dialog.render();
    }
}
//UI PAGE

<?xml version="1.0" encoding="utf-8"?>
<j:jelly trim="true" xmlns:j="jelly:core" xmlns:g="glide">
    <g:ui_form>
        <table class="wide">
            <tr>
                <td nowrap="nowrap" align="right">
                    <img src="lockblue.png" width="30" height="30"/>
                </td>
                <td nowrap="true">
                    <strong>Deactivation Warning</strong>
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <p style="color: rgb(0, 0, 0); padding-bottom: 10px;">
                        (Contents Line 1)
                        <p style="font-weight:bold; color: rgb(204, 0, 0); padding-bottom: 10px;">
                       (Contents Line 2)
                        </p>
                    </p>
                </td>
            </tr>
        </table>
        <!-- Buttons -->
        <div style="text-align: center; margin-top: 20px;">
            <button type="button" onclick="window.location.reload();" style="padding: 10px 20px; background-color: #d9534f; color: white; border: none; border-radius: 5px; cursor: pointer; margin-right: 10px;">
                Cancel
            </button>
            <button type="button" onclick="gsftSubmit(null, g_form.getFormElement(), 'sysverb_update_and_stay');" style="padding: 10px 20px; background-color: #5cb85c; color: white; border: none; border-radius: 5px; cursor: pointer;">
                OK
            </button>
        </div>
    </g:ui_form>
</j:jelly>

 



1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Community Alums 

use this

        var dialog = new GlideModal('UI_PAGE', true);

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

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

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Community Alums 

use this

        var dialog = new GlideModal('UI_PAGE', true);

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

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

@Community Alums 

if we use GlideDialogWindow then we can use this

dialog.removeCloseDecoration();

But since we are using GlideModal, we can send 2nd parameter as true and cross icon is gone.

 

AnkurBawiskar_0-1737547772262.png

 

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

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

Community Alums
Not applicable

Seriously! Simple as that! 🤣

Thanks again @Ankur Bawiskar

@Community Alums 

Yes indeed !

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