Take Advantage of Map/Reduce Script

One of the coolest new feature introduced with SuiteScript 2.0 is the Map/Reduce script type.  Map/Reduce provides parallel processing, dynamic governance handling and yielding and ability to break out business process into separate logical segments.  Only downfall to Map/Reduce script is that it doesn’t make that big of a difference if you don’t have SuiteCloud Plus License.  NetSuite SuiteCloud Plus License grants multiple script queues (1 SC+ License grants 5 script processing queues) which allows multiple scripts to run simultaneously.  However, recently NetSuite announced that they will grant one additional complimentary queue for those without SC+ license starting 2018.1 release.  With 2 processing queues, it is time to take advantage of Map/Reduce script!!!

In this blog post, we’d like to give you sample business use case which can be implemented with simple Map/Reduce script.

Sample Business Use Case:
You have large number of Sales Orders that needs to be invoiced on a scheduled basis.

Code Implementation

1. Create Map/Reduce Script code
This sample script only use Map stage since the use case only requires that we generate an invoice from each eligible sales order.

1. Create Map/Reduce Script code
Upload your script to NetSuite and it will automatically identify it as Map/Reduce script.

You can now deploy your script and set additional setting for this Map/Reduce script.

This is just a simple example of using Map/Reduce script.  We only used Map stage in this example since we only had to create an invoice off of sales order.  If you have more complex business logic, you can utilize Reduce stage as well.

Even with one additional queue, Map/Reduce script will allow you to process data twice as fast.  We are certainly looking forward to 2018.1 so that all of our customers can take advantage of this feature.

Do you have large number of complex business process automated? or Improve existing ones? Give us a call!

About Abaci
Abaci is a premier NetSuite Solution Provider with deep knowledge in both business process and technology architecture. Our team is passionate about NetSuite and has an exclusive commitment to NetSuite and to providing the highest level of system expertise on its full suite of cloud-based business management applications.