Background scripts/scheduled scripts not running??

tomlumbard
Kilo Expert

I have a number of scripts I want to run to bulk update data on various tables. I have tested this via scheduled script on our dev and test instances and it woks as expected. These are clones of our production instance. When I try and run them as scheduled scripts on demand they never run? And if I try and run them as Background script I just get a white screen and nothing runs? Am I missing something?

Example script;

var alm = new GlideRecord('alm_hardware');

alm.addQuery('u_delivered_date', '');

alm.query();

while(alm.next()){

        alm.u_delivered_date = alm.sys_created_on;

  alm.u_scripted_depriciation = true;

   

        alm.update();

}

1 REPLY 1

Chuck Tomasi
Tera Patron

Hi Tom,



Your script has no output. If you want to try it in scripts background, try throwing in a gs.log() statement inside the loop to create some output that you can ensure records are being processed.



var alm = new GlideRecord('alm_hardware');


alm.addQuery('u_delivered_date', '');


alm.query();


while(alm.next()){


        alm.u_delivered_date = alm.sys_created_on;


  alm.u_scripted_depriciation = true;


 


        alm.update();


        gs.log(alm.display_name + ' updated');


}



As for scheduled jobs not running, it sounds like your production instance may have an issue. Check under Scheduled Jobs> System Scheduler, and Today's Scheduled Jobs to see if everything looks OK. If not, reach out to customer support immediately so they can dig deeper.