I ran this script in the background and it doesn't stop running and everything is slow, how do I stop it if I can't load any pages?

1231
Tera Contributor

find_real_file.png

var gr = new GlideRecord('sc_request');
gr.query();
while(gr.next()) {
gr.u_opened_for=gr.requested_for.getDisplayValue(); 
gr.setLimit(5);
gr.query(); gr.print();
//gr.update();
}
1 ACCEPTED SOLUTION

Your current instance node is looping the script. Until it is able to clear itself by timing out you will likely need to switch nodes.

Logout of your instance and clear your browser cache. Then do a fresh login and you should get a different node. If this doesn't work you can switch nodes via browser plugins like SN Utils.

View solution in original post

14 REPLIES 14

Open new tab in your browser

https://<INSTANCE>.service-now.com/cancel_my_transaction.do  and Enter

Best Regards
Aman Kumar

It worked for me .

Ian Mildon
Tera Guru

Further to Aman's post, if you want to print the output in the Scripts - Background window use this:

var gr = new GlideRecord('sc_request');
gr.setLimit(5);
gr.query();
while(gr.next()) {
    gr.u_opened_for=gr.requested_for.getDisplayValue(); 
    gr.update();
    gs.print(gr.u_opened_for);
}

1231
Tera Contributor

But the page is frozen, I can't even run the script again or load the page again

Hello,

Close the browser or Ask someone who has admin access to kill the transaction, Also as per best practice it is recommended to use 'Fix script' that in too in Background as seen in below screenshot. Good Luck!

find_real_file.png

Please hit like and mark my response as correct if that helps
Regards,
Musab