Is there a way to prevent pop-ups from closing on click

sony5
Kilo Contributor

Hi,

 

When I click on "pop-up" icon against any reference field, and perform any action (on click on any button eg Save), on the pop-up window it closes the pop-up window.

Is there a way I can avoid the pop-up window from closing on click.

 

Thanks,

Sony

1 ACCEPTED SOLUTION

Slava Savitsky
Giga Sage

As far as I know, there is no such option in the base system. A possible workaround is to create a UI Script that would redefine the out-of-box function that opens the reference pop-up. The downside of this approach, however, is that if ServiceNow makes a change this feature in a future version of the product, your customization may stop working, so you will have to test it every time you do an upgrade. If you would like to give it a try anyway, create a UI Script with the following values:



Active: true


Global: true


Script:


function tearOff(table, sys_id, view, navigate) {


        var key = sys_id;


        var url = new GlideURL(table + '.do');


        url.addParam("sys_id", key);


        url.addParam("sysparm_view", view);


        url.addParam("sysparm_stack", "no");



        window.open(url.getURL(), "",


        "toolbar=no,menubar=no,personalbar=no,width=800,height=600," +


        "scrollbars=yes,resizable=yes");


        if (navigate) {


                  gsftSubmit(document.getElementById('sysverb_back'));


        }


}



The only difference between this script and the one built in the base system is that I removed line 7 which looked like this:


url.addParam("sysparm_referring_url", "tear_off");



To revert to the out-of-box behavior, either add that line back or deactivate your UI script.


View solution in original post

2 REPLIES 2

Slava Savitsky
Giga Sage

As far as I know, there is no such option in the base system. A possible workaround is to create a UI Script that would redefine the out-of-box function that opens the reference pop-up. The downside of this approach, however, is that if ServiceNow makes a change this feature in a future version of the product, your customization may stop working, so you will have to test it every time you do an upgrade. If you would like to give it a try anyway, create a UI Script with the following values:



Active: true


Global: true


Script:


function tearOff(table, sys_id, view, navigate) {


        var key = sys_id;


        var url = new GlideURL(table + '.do');


        url.addParam("sys_id", key);


        url.addParam("sysparm_view", view);


        url.addParam("sysparm_stack", "no");



        window.open(url.getURL(), "",


        "toolbar=no,menubar=no,personalbar=no,width=800,height=600," +


        "scrollbars=yes,resizable=yes");


        if (navigate) {


                  gsftSubmit(document.getElementById('sysverb_back'));


        }


}



The only difference between this script and the one built in the base system is that I removed line 7 which looked like this:


url.addParam("sysparm_referring_url", "tear_off");



To revert to the out-of-box behavior, either add that line back or deactivate your UI script.


Anurag Tripathi
Mega Patron
Mega Patron

Hover over the reference icon and Press   and hold the Shift key . A "X" will appear on the right top corner of the popup, now u can move your mouse away and the popup will stay till u hit the "X"


-Anurag