0
votes

I wrote a SuiteScript 2.0 Map/Reduce script. The getInputData function just loads a transaction search, and then within the map function I'm just loading a SalesOrder record and getting field and sublist info. Not setting any values or saving the record or anything. (I'm building JSON files with the results at the end)

My problem is that I keep hitting WF_EXEC_USAGE_LIMIT_EXCEEDED exception after it processes a few hundred records. The exception is thrown on the record.load line for the sales order. We do have a few workflows running on the Sales Order record, so I disabled all of them by changing the Release Status to 'Not Initiating', but the exception happens anyway which seems really odd to me. I thought perhaps it had something to do with 'Active Workflows', because some of the records do have an Active Workflow value, but then I realized that some don't. So it doesn't seem likely that's the problem. (I should also mention that this same script works on other records, such as contacts.)

How in the world do I get around this WF_EXEC_USAGE_LIMIT_EXCEEDED message? If disabling the workflows doesn't even work, I'm at a loss and information related to this exception seems practically nonexistent. Any help would be appreciated. Thanks!

1

1 Answers

1
votes

I think the issue is with the governance the map stage has only 1000 governance. Instead of map use both map and reduce which has 5000 governance... Prepare key in the map stage and send it to reduce then load your record and create a JSON file...

Otherwise, load record in the reduce stage and sent record object to summary stage then prepare your JSON file in the summary stage. (A summary stage has governance 10,000.

https://netsuite.custhelp.com/app/answers/detail/a_id/48911/kw/map%20reduces%20governance