I have 5 instances/deployments of one schedule scr...
# suitescript
t
I have 5 instances/deployments of one schedule script. All are scheduled for daily run from 12 am at every 15 minutes. While two are running fine , I am getting  Code : FAILED_TO_SUBMIT_JOB_REQUEST_1 Description : Failed to submit job request: INQUEUE. in the other 3. Do anybody know how to resolve this ?
nlapisubmitField is throwing this , I have caught the error. But why ?
b
look at the user event scripts deployed on that record
t
Yes , this is due to one User event , which is doing this @battk
var mrTask = task.create({ taskType: task.TaskType.SCHEDULED_SCRIPT, scriptId: 'customscript_upy_updateitembins', deploymentId: 'customdeploy_upy_updateitembins', params: {custscript_upy_recid : recId, custscript_upy_transtype : newRec.type} }); // Submit the map/reduce task. var mrTaskId = mrTask.submit();
due to submission of this task, last line
b
that code will not handle concurrency of any kind
the error is saying that the scheduled script that is trying to be submitted is already in the queue
t
Ohh, and that is because I am submitting field on multiple item records
So that will trigger UE on all of those records
That means then multiple scripts are being submitted
ohh
If I sumbit field for 10 items, that will sumbit the script for all 10 items, and that is taking me to this error.
Can I escape a specific user Event from a particular Schedule script. @battk
b
no, ideally the user event script is fixed
t
What can I do now, if I have to submit a field in my Schedule script ?
b
if you cant fix the user event, i guess try/catch that particular error
t
Okay, I can catch that in my schedule , but that will keep generating error in that UE {"type":"error.SuiteScriptError","name":"FAILED_TO_SUBMIT_JOB_REQUEST_1","message":"Failed to submit job request: INPROGRESS.","stack":["createError(N/error)","afterSubmit(/SuiteScript....... like this