KM
12/18/2025, 12:34 PMCeligo AI
12/18/2025, 12:34 PMAI generated answer (using internal Slack threads):To run a Map/Reduce script task in SuiteScript, you can use the
N/task module. This module allows you to create a task of type MAP_REDUCE and submit it for execution. Here is a sample code snippet:
javascript
var task = require('N/task');
var mrTask = task.create({
taskType: task.TaskType.MAP_REDUCE,
scriptId: 'customscript_your_script_id',
deploymentId: 'customdeploy_your_deployment_id'
});
var taskId = mrTask.submit();
In this code, replace 'customscript_your_script_id' and 'customdeploy_your_deployment_id' with your actual script and deployment IDs.
You can also create a Suitelet that triggers the Map/Reduce task. This can be useful if you want to provide a user interface for starting the task, or if you want to automate the task execution in response to certain events.
Please note that you can also call another Map/Reduce script from the summary stage of a Map/Reduce script. Here is a sample code snippet:
javascript
var task = require('N/task');
function summarize(summary) {
var mrTask = task.create({
taskType: task.TaskType.MAP_REDUCE,
scriptId: 'customscript1',
deploymentId: 'customdeploy1'
});
var taskId = mrTask.submit();
}
In this code, replace 'customscript1' and 'customdeploy1' with your actual script and deployment IDs.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
12/18/2025, 12:35 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.864441
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.863708615
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.862732
Celigo AI
12/18/2025, 12:35 PM