Hi Guys, in my map/reduce script, code below for s...
# suitescript
v
Hi Guys, in my map/reduce script, code below for summarize gives noOfEmailsSent = 1 always, irrespective of the number of records/email processed.
Copy code
function summarize(context) {
        var noOfEmailsSent = 0;
        context.output.iterator().each(function () { noOfEmailsSent++; });
        var summaryMessage = "Usage: " + context.usage + " Concurrency: " + context.concurrency +" Number of yields: " + context.yields + " Total Emails Sent: " + noOfEmailsSent;
        log.audit({ title: 'Summary of usase', details: summaryMessage });
      }
b
basically all of netsuite's iterator functions require you to return true to continue
returning false, or nothing (or honestly any falsy value) will stop the iteration
v
This worked. Thanks a lot!