april_mcgehee
ServiceNow Employee
ServiceNow Employee

In UI15, when viewing a request item that has the list collector variable on the form, you are prompted that you have made a change when leaving/reloading the page. If a list collector variable is on a form and the changeFlag is set to 'true,' the system will interpret this as something on the form being changed. This results in a "Confirm Reload" dialog box to pop up with two options: reload the page, or don't reload and continuing will discard the changes.


Note: This can also occur on other forms with the variable editor.

Blog pic 5.jpg

To workaround the list collector variable triggering the "Confirm Reload" dialog box, create an onLoad Client Script on Request Item (sc_req_item) or any other form that has a variable editor.


Use this code:

function onLoad() {
        if (typeof g_sc_form !== 'undefined') {
                    g_sc_form.fieldChanged = function(variableName, changeFlag) {
                                                 
if (g_form && g_form !== this)
                                g_form.fieldChanged(variableName, changeFlag);
                                                 
this.modified = true;
                             
};
          }
         
}


This behavior is seen in Eureka Patch 2, Fuji Patch 1, Fuji Patch 2 Hot fix 1, Fuji Patch 3, and Fuji Patch 4. Users who have upgraded to Fuji Patch 5 will no longer encounter the pesky "Confirm Reload" dialog pop-up.

4 Comments