CapaJC
ServiceNow Employee
ServiceNow Employee

Are you an admin that frequently needs to refresh the form you're on? Whether for testing purposes, or some other reason? Tired of right-clicking the form header to do it?

I know others have solved this their own way, but here's mine. A global UI Script with the following script puts an icon in your form header to refresh the form:



addRenderEvent(bounce);
function bounce() {
if (!g_user.hasRole("admin"))
return;

var e = $("mandatory_explained");
if (!e)
return;

var p = e.parentNode;
var span = document.createElement("span");
span.setAttribute("id", "refresh_this_form");
p.insertBefore(span, e);
span.innerHTML = " <span class='pointerhand' onclick='reloadWindow(window);' style='padding-left:4px;'><img width='16' height='16' src='images/icons/refresh.gifx'></span>";
}

2 Comments