Any weird permission I'm missing for a RESTlet to ...
# suitescript
a
Any weird permission I'm missing for a RESTlet to execute a Map Reduce Script? I'm getting failed every single time, however when I execute this manually from the UI it works correctly...
b
MapReduceScriptTask.submit() documents the permissions you need
a
These permissions are present: SuiteScript and SuiteScript Scheduling permissions, the Map Reduce is being executed but fails in the getInputData stage even if I do something as simple as return ['1', '2', '3']. The very same Map Reduce runs correctly when manually executed from the UI.
Imagine a Map Reduce with literally only getInputData:
Copy code
const getInputData = (inputContext) => {

    return ['1', '2', '3'];
}
message has been deleted
Every execution from the RESTlet Fails but a manual execution is OK... no error or anything... just FAIL...
My Summary Stage:
Copy code
const summarize = (summaryContext) => {

    /* Checking for Errors */
    handleErrorIfAny(summaryContext);
}
Copy code
/**
 * Handle error (if any) right now just log and email, but could be expanded.
 *
 * @param {Object} pSummary
 */
const handleErrorIfAny = (pSummary) => {

    const oInputSummary = pSummary.inputSummary;
    const oMapSummary = pSummary.mapSummary;
    const oReduceSummary = pSummary.reduceSummary;

    if (oInputSummary.error) {

        var oError = error.create({
            name: 'INPUT_STAGE_FAILED',
            message: oInputSummary.error
        });

        handleErrorAndSendNotification(oError, 'getInputData');
    }

    handleErrorInStage('map', oMapSummary);
    handleErrorInStage('reduce', oReduceSummary);
}
No errors anywhere... just FAIL...
netsuite 1
b
the undocumented one is Documents and Files
a
Yep that one was the one... just did it before reading this...
So the Map Reduce sorts or whatever happens in the File Cabinet which once again means is not really a file system but a DB virtual FS...
Thanks...