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-11-2015 03:54 AM
Thank You

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2016 06:30 PM
Hi Mark,
I am trying to use the ctrl+shift+alt+j in list edit to check the number of records selected in list edit. However it is not working, can you pls help me on this, where it went wrong, I am trying to use the code in the UI action.
var getChecked = g_list.getChecked();
var sys_id = getChecked.split(",");
var countChecked = sys_id.length;
alert(countChecked);
Thanks!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2016 07:41 PM
Use Xplore to test code
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022