updating a field by scheduled job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2016 07:20 AM
Hi All
I wrote a scheduled job to update a field. It showed that the count is 15400. But it didnot update around 600 records. When i filter the records i frontend, it shows 15400. How come count is showing correct in log but 600 records didnot get updated.
I again re-run the scheduled job and it said it updated 600. But when i saw those records didnot show any updation of that field.
What could be the possible cause?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2016 11:21 AM
Any thoughts?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2016 11:36 AM
Try setting setWorkflow() to false.
Check();
function Check(){
var gr = new GlideRecord('cmdb_ci');
gr.addEncodedQuery("install_status=1^ORsys_updated_on<javascript:gs.dateGenerate('2014-08-01','00:00:00')");
gr.query();
while(gr.next())
{
gr.u_date = 'Retire'; //u_date is a string field
gr.setWorkflow(false);
gr.update();
}
gs.log("Executed "+ gr.getRowCount()+ " records.");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2016 11:41 AM
Hi Abhinay,
Still I see those 600 records not updated and in gs.log i get the message that Executed 600 recods
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2016 11:44 AM
That means the GlideRecord query is capturing that correct records but you are unable to update them. Did you check if there are any ACLs restricting you to update them? Take one of those records and try manually updating them and see if you can or not.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2016 11:46 AM
ACL evaluation will not take place when you are updating the records using GlideRecord queries. So ACL's are out of equation here.