schedule map/reduce script for a future time, with...
# ask-stanley-ai
p
schedule map/reduce script for a future time, with a script
c
AI generated answer (using internal Slack threads):
To schedule a Map/Reduce script for a future time, you can use the
N/task
module in SuiteScript 2.0. Here is a sample code snippet:
Copy code
javascript
var scriptTask = task.create({taskType: task.TaskType.MAP_REDUCE});
scriptTask.scriptId = 'customscript_my_mr_script';
scriptTask.deploymentId = 'customdeploy_my_mr_script';
scriptTask.params = {custscript_my_param: 'my value'};
var scriptTaskId = scriptTask.submit();
In this example,
customscript_my_mr_script
is the script ID and
customdeploy_my_mr_script
is the deployment ID of your Map/Reduce script. The
params
property is used to pass parameters to the script. However, please note that NetSuite has a limitation on how frequently a Map/Reduce script can be scheduled. The minimum interval is 15 minutes. If you need to run a script more frequently, you might need to use an external process to trigger the script via a RESTlet or Suitelet, or have the script re-schedule itself to run again as soon as it completes. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837326407
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.834836781
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.830377221
Please provide your feedback on this answer.