hi, I am trying to pass some data from a UE afterS...
# suitescript
m
hi, I am trying to pass some data from a UE afterSubmit to a Map Reduce. In the UE, I have something like:
function afterSubmit(context){
var exampleData = '31396046';
var scriptTask = task.create({
taskType: task.TaskType.MAP_REDUCE
});
scriptTask.scriptId = 'customscript_some_valid_script_id';
scriptTask.deploymentId = 'customdeploy_some_valid_deploy';
scriptTask.params = {
custscript_data: exampleData
};
var scriptTaskId = scriptTask.submit();
}
And in the getInputData of the M/R, something like:
var script = runtime.getCurrentScript();
var needThis = script.getParameter({name:'custscript_data'});
log.debug("data needed", needThis);
So the M/R fires, and the log hits, but
needThis
is empty. Obviously, I'd like it to be the exampleData var from the UE script. I am guessing i've set something up incorrectly? Is the param name set in the M/R deployment record? Thank you.
b
script parameters are basically like custom fields
you need to create a script parameter on the script deployment
m
ok, thanks, I was somewhat thinking that because I saw somewhere online about a parameters tab on the deployment in NS, but I just didn't see that tab and hoped I could set them this way.
https://1259134-sb1.app.netsuite.com/app/help/helpcenter.nl?fid=chapter_n2999459.html On the script, not the script deployment; I was looking in the wrong place. Oof. Thanks again