Hi Guys, how do you implement N/query in Map/Reduc...
# general
r
Hi Guys, how do you implement N/query in Map/Reduce Script?
mapReduceSuiteQL_js.js
The short answer is that, if you only want the getInputData to run a SuiteQL query, and won’t be using it anywhere else (in your map, reduce, or summarize functions) then you don’t even need to include the N/query module in your script, you can just use the syntax described in the SuiteAnswers article above to return the SuiteQL query, and Netsuite will run it for you.
If you want to use it elsewhere in a M/R script, you would include the module and use it as you would in any other script type.
r
@scottvonduhn can you give me a sample of a code structure- for instance I wanted to get the customer's past due invoices, and send it to them via email. I'm a little bit confused on how am I going to structure my code if I will be using the map/reduce functions with a N/query module.