- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2016 07:36 AM
I am trying to run a BG script that should tell the sc_task records are in the state of 7 and updting them to a new value. 7 being the 'value' of the field. When I run the query nothing is printed out. I have verified there is in fact a record with that state but receive nothing in the window after i run the script. There is also nothing in the log that would indicate an error.
var gr = new GlideRecord('sc_task')
gr.addQuery('state',7);
while (gr.next()){
gs.print('Number updated= '+ gr.number)
gr.state = 2;
gr.update();
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2016 07:58 AM
Refresh the page, I believe security admin rights have been expired . Elevate your privileges again and open the background script and try now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2016 07:41 AM
HI
I believe that you skip
gr.query();
Thanks
Akash Sharma
PS Hit like correct of helps