Can you create 3 deployments for a Map/Reduce and ...
# suitescript
n
Can you create 3 deployments for a Map/Reduce and then when deployment1 is complete run deployment2 and so on
b
you can, though i would question why you wouldnt just use one
n
Well I have two searches I need to load and combine. So what I am doing is loading one and adding results to custom record. Then running 2nd deployment on the second search and doing the same thing. But I also need to mark the existing custom records as inactive before deployemnt1 so there is always a new data set
b
ill ignore the why you need to searches part for now
but you can use N/task to add the current map/reduce script deployment back into the queue
n
how would you do the n/task part?
b
n
hm so I had this in my code and it didn't work:
Copy code
var MapReduceScriptTask = task.create({
                        taskType: task.TaskType.MAP_REDUCE,
                        scriptId: 'customscript_nco_mr_fixedassetreporting',
                        deploymentId: 'customdeploy2'
                    });
                    MapReduceScriptTask.submit()
b
you are going to need to explain better than ``didn't work``
n
The MR deployement2 never ran and never received any errors
b
what was the task id returned from
MapReduceScriptTask.submit
n
It doesn't even return it. It
is like the code is not even there. Tried logging it and nothing
b
are you sure there isnt an error
n
Actually hold on, i'm an idiot. sorry @battk just now realizing I didn't add the N/task module. 🤦‍♂️
it's working now