JavaScript Executor Question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2012 02:44 PM
Hi,
I'm trying to run the script below using the JavaScript Executor (Ctrl-Alt-Shift-J). Nothing happens when I click "Run my code." Is something wrong with the code, or is this not the right place to run it?
Thanks, JiM
<script> //Generic Incident update script. Update query and update lines var gr = new GlideRecord('incident'); gr.addQuery('u_source','Walk-in'); //Change query to field being updated //gr.addQuery('u_subcategory','USFwebsite'); //gr.addQuery('field','value'); gr.query(); while (gr.next()) { gr.u_category = 'LMN Walk-in'; //Change to field being updated gr.setWorkflow(false); gr.autoSysFields(false); gr.update(); } </script>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2012 02:46 PM
That's a client-side functionality. You're running some server-side code there. If you need to run server-side code you can use the 'Scripts-Background' module or an on-demand scheduled job.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2012 02:53 PM
Thanks Mark

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2015 01:23 AM
Hi,
How can i go to scripts background.
is there any short cut.
can u please help me with this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2015 02:28 AM
Hi Ashutosh,
To access the Scripts - Background, you have to log in as admin and then click the lock icon at the right of the message Welcome System Administrator (in the top of the home screen) to get elevated privileges. Once you select security_admin privileges, you find the Scripts - Background in the application menu under System Definition.