leo_ns
02/01/2024, 6:22 PMNathan L
02/01/2024, 6:36 PMNathan L
02/01/2024, 6:38 PMconst createMrTask = (invoiceObject) => {
const mrTask = task.create({
taskType: task.TaskType.MAP_REDUCE,
scriptId: 'customscript_some_script_name',
params: {
custscript_some_parameter_names: JSON.stringify(invoiceObject)
}
});
return mrTask.submit();
};
leo_ns
02/01/2024, 6:39 PMEdgar Valdes
02/01/2024, 6:39 PMleo_ns
02/01/2024, 6:40 PMleo_ns
02/01/2024, 6:40 PMNathan L
02/01/2024, 6:41 PMNathan L
02/01/2024, 6:42 PMconst getInputData = (inputContext) => {
try {
const param = JSON.parse(
runtime.getCurrentScript().getParameter({ name: 'custscript_some_parameter_names' })
);
return param;
} catch (e) {
log.error({ title: 'error in getInputData', details: e });
}
};
Nathan L
02/01/2024, 6:44 PMleo_ns
02/01/2024, 6:44 PMNathan L
02/01/2024, 6:45 PMMarvin
02/01/2024, 6:45 PMleo_ns
02/01/2024, 6:45 PMNathan L
02/01/2024, 6:47 PMleo_ns
02/01/2024, 6:48 PMMarvin
02/01/2024, 6:49 PMreptar
02/01/2024, 7:29 PMleo_ns
02/01/2024, 7:29 PMreptar
02/01/2024, 7:31 PMreptar
02/01/2024, 7:31 PMleo_ns
02/01/2024, 7:33 PMleo_ns
02/01/2024, 7:34 PMreptar
02/01/2024, 7:35 PMleo_ns
02/01/2024, 7:35 PMreptar
02/01/2024, 7:36 PMleo_ns
02/01/2024, 7:36 PMreptar
02/01/2024, 7:37 PMreptar
02/01/2024, 7:37 PMleo_ns
02/01/2024, 7:38 PMleo_ns
02/01/2024, 8:26 PMleo_ns
02/01/2024, 8:29 PMNathan L
02/01/2024, 8:35 PMresultArray.join(',')
Then in your map/reduce script
Using the N/runtime module
const inputArray = runtime.getCurrentScript.getParameter({name: custscript_your_parameter_name}).split(',')
leo_ns
02/01/2024, 8:43 PMMarvin
02/01/2024, 8:45 PMMarvin
02/01/2024, 8:46 PMleo_ns
02/01/2024, 8:50 PMNathan L
02/01/2024, 8:51 PMNathan L
02/01/2024, 8:52 PMNathan L
02/01/2024, 8:52 PMleo_ns
02/01/2024, 8:56 PMleo_ns
02/01/2024, 8:58 PMleo_ns
02/01/2024, 8:59 PMNathan L
02/01/2024, 9:00 PMNathan L
02/01/2024, 9:01 PMleo_ns
02/01/2024, 9:03 PMNathan L
02/01/2024, 9:03 PMleo_ns
02/01/2024, 9:05 PMNathan L
02/01/2024, 9:07 PMNathan L
02/01/2024, 9:09 PMleo_ns
02/01/2024, 9:11 PMNElliott
02/02/2024, 10:02 AMMarvin
02/03/2024, 12:21 AMN/record
?reptar
02/05/2024, 2:41 PMNElliott
02/05/2024, 4:11 PMscheduledScrDeployment = record.create({
type: Record.Type.SCRIPT_DEPLOYMENT,
defaultValues: {
script: scheduledScrInternalId,
},
})
but you could use copy I guess. šShawn Talbert
02/05/2024, 4:20 PMNathan L
02/05/2024, 4:21 PMShawn Talbert
02/05/2024, 5:04 PM