I need to process 16k records. To do this I've scheduled a script to run with a increasing starting index to handle the updates in 500 record blocks.
It seems to have executed the first scheduled script, but now nothing else is happening.
Is it possible to see a list of the scripts that are scheduled for execution? If not.... how in the world do we debug such a scenario?
Here is the code I used to schedule the scripts:
try { // This code should run on the server, try getting the parameter from the request var startId = parseInt(request.getParameter('start')); if(startId == null) { response.writeLine('You must specify a starting ID!'); return; } var log = ''; var a = new Array(); var numScheduledScripts = 1; // process the record(s)! while(startId < 16457) { a['custscript1'] = startId; nlapiScheduleScript('customscript33','customdeploy1', a); log += 'Scheduled script ' + numScheduledScripts + ' with a starting ID of ' + startId + 'n'; startId += 500 response.writeLine('startId: ' + startId); } } catch(error) { var errorMsg = CreateFormattedExceptionMsg(error); response.writeLine(errorMsg); } finally { //response.writeLine('Last succsessful id processed: ' + lastSuccsessfulIdProcessed); response.writeLine(log); } The output from the above code prints:
startId: 1768
startId: 2268
startId: 2768
startId: 3268
startId: 3768
startId: 4268
startId: 4768
startId: 5268
startId: 5768
startId: 6268
startId: 6768
startId: 7268
startId: 7768
startId: 8268
startId: 8768
startId: 9268
startId: 9768
startId: 10268
startId: 10768
startId: 11268
startId: 11768
startId: 12268
startId: 12768
startId: 13268
startId: 13768
startId: 14268
startId: 14768
startId: 15268
startId: 15768
startId: 16268
startId: 16768
Scheduled script 1 with a starting ID of 1268
Scheduled script 2 with a starting ID of 1768
Scheduled script 3 with a starting ID of 2268
Scheduled script 4 with a starting ID of 2768
Scheduled script 5 with a starting ID of 3268
Scheduled script 6 with a starting ID of 3768
Scheduled script 7 with a starting ID of 4268
Scheduled script 8 with a starting ID of 4768
Scheduled script 9 with a starting ID of 5268
Scheduled script 10 with a starting ID of 5768
Scheduled script 11 with a starting ID of 6268
Scheduled script 12 with a starting ID of 6768
Scheduled script 13 with a starting ID of 7268
Scheduled script 14 with a starting ID of 7768
Scheduled script 15 with a starting ID of 8268
Scheduled script 16 with a starting ID of 8768
Scheduled script 17 with a starting ID of 9268
Scheduled script 18 with a starting ID of 9768
Scheduled script 19 with a starting ID of 10268
Scheduled script 20 with a starting ID of 10768
Scheduled script 21 with a starting ID of 11268
Scheduled script 22 with a starting ID of 11768
Scheduled script 23 with a starting ID of 12268
Scheduled script 24 with a starting ID of 12768
Scheduled script 25 with a starting ID of 13268
Scheduled script 26 with a starting ID of 13768
Scheduled script 27 with a starting ID of 14268
Scheduled script 28 with a starting ID of 14768
Scheduled script 29 with a starting ID of 15268
Scheduled script 30 with a starting ID of 15768
Scheduled script 31 with a starting ID of 16268
Anyone see a problem with this code?