is there a way to check if a Map/Reduce script is ...
# suitescript
e
is there a way to check if a Map/Reduce script is currently running? Use case is a user-event script will trigger the execution of the map/reduce script but it has to know if the script is already running, I am getting theMAP_REDUCE_ALREADY_RUNNING error
n
Check out the N/task API, specifically: task.MapReduceScriptTaskStatus
👍 1
e
thanks
👍 1
d
Another approach is putting the task.submit() inside a try/catch, and if that error raises, simply ignore it (or log it).
👍 2
m
You can also run saved searches on running Map Reduce instances (
search.Type.SCHEDULED_SCRIPT_INSTANCE
)
👍 1