Scripted Scheduled Job is not updating all Glide Query Records.

basantsoni
Kilo Guru

Hello friends,

I written a scripted scheduled on daily basis, that basically to glide record of CMDB_Computer Table and as per the condition it’s to update 11000 records. I can observer that scheduled job is working for all records as per glide record conditions. I print some messages that are common for all. I can see out of 10000+ only 2500+ messages has been printed in logs.

Due to this issue, the update transactions on records that scheduled job has to perform is not performing and because of this problem many results and expected values we are getting.

Yesterday, I stop many print messages from Script job and Script Include functions as well. Any reasons why this happening or Scheduled Job Operations are getting time out.

Thanks,

Basant

 

1 ACCEPTED SOLUTION

You could break your script down and use "scheduleonce" to schedule parts of the code and have it run asynchronously. For instance divide the records into arrays of 1000 records and then do the schedule once. There is an article on the topic here:

http://www.john-james-andersen.com/blog/service-now/call-a-servicenow-script-asynchronously-with-scheduleonce-api.html

It is a little difficult to help, not knowing what code you are trying to run, but I hope this helps!

View solution in original post

4 REPLIES 4

Fabian Kunzke
Kilo Sage
Kilo Sage

Hi,

Could you please provide the scheduled job mentioned.

Greetings

Fabian

lasse3
Mega Guru

It is difficult to say without knowing the code that you are trying to run. Could you please share the code that you are having issues with?

basantsoni
Kilo Guru

Hi Friends,

Thanks for rely. But i wont be able to paste the code here. since it's too big. put print message that should return row count : gs.print('Total Number of Records : Schedule Job New  :'  +gr.getRowCount()); but it's printing this message.

I think, Scheduled Job or Background Script  or Fix Script is not processing all records. it's getting timeout and cancelling DB Translations.

 

Do we have many API's or any solutions that'll perform db translation from a Scheduled Job or Background in chunks. i think that will help us here.

thanks, 
Basant 

You could break your script down and use "scheduleonce" to schedule parts of the code and have it run asynchronously. For instance divide the records into arrays of 1000 records and then do the schedule once. There is an article on the topic here:

http://www.john-james-andersen.com/blog/service-now/call-a-servicenow-script-asynchronously-with-scheduleonce-api.html

It is a little difficult to help, not knowing what code you are trying to run, but I hope this helps!