Hello, I am trying to create a map/reduce script b...
# suitescript
m
Hello, I am trying to create a map/reduce script but when I attempt to upload the script file to the sandbox, I am getting this error and have not been able to find any information as to what it means. Any help would be appreciated
Fail to evaluate script: {"type":"error.SuiteScriptModuleLoaderError","name":"{stack=[Ljava.lang.Object;@255c5601, toJSON=org.mozilla.javascript.InterpretedFunction@610c2018, name=MODULE_DOES_NOT_EXIST, toString=org.mozilla.javascript.InterpretedFunction@6e09e89a, id=, message=Module does not exist: /SS_SCRIPT_FOR_METADATA.js, TYPE=error.SuiteScriptModuleLoaderError}","message":"","stack":[]}
This is the script that I am uploading:
Copy code
/**
*@NApiVersion 2.x
*@NScriptType MapReduceScript
*/
define(['N/Search', 'N/Record', 'N/Log'],

function(search, record, log){
	function getData(){
		//extract data
		
	}
	
	function ItemVendorMap(context){
		//processing data
		
	}
	
	function reduce(context){
		//if task is big then we use this as well
		
	}
	
	function summarize(summary){
		//handling the text data and logging test data
		
	}
	
	return{
		getInputData: getData,
		map: ItemVendorMap,
		reduce: reduce,
		summarize: summarize
	};
});
a
modules names don't have CAPS in them
'N/search'
,
'N/record'
1
also you don't need to include N/log its always available
m
OMG how did I miss that? Thank you
👍 1
s
FWIW, if you used typescript that would probably have been caught before you ever even tried to upload the script.
🙌 1
m
thank you, I'll check that out as well