Have a scheduled script running a lot of updates o...
# suitescript
n
Have a scheduled script running a lot of updates on Sales orders, this queries the items and availability etc. Running into a "SSS_USAGE_LIMIT_EXCEEDED" limitation. Any thoughts on workarounds?
n
You could move it to a map reduce script to take advantage of the higher governance limits. Or look at the scheduled scripts searches and see if there is any way to combine them. Also any record updates, if you can, dont load the record. Just set fields with record.submitFields(). Best option though if possible is to move it to map/reduce
r
Replace iterative searching with a single search.
FYI
record.submitFields()
only works on body level record updates.
A good skill to learn is figuring out how many governance points you're using. If you majored in CS you've probably done this with Big O notation / time complexity exercises. You should be able to figure out how much governance is used for a given n. (Where n is often the number of records to update.)
Each script type has a limit, every API has a number of governance points.
n
@reptar is there a way I can update the line items without loading the record?
r
beforeSubmit?
n
yea, like im running a saved search, where instead of doing multiple searches I do one. but I want to update each line item with a corrected date
all of the line items have back ordered counts
r
Map Reduce has plenty of governance for that. You could do a record load per map stage
n
My concern with map reduce is keeping total counts from POs, so im going to stick with the scheduled for now.
r
I don't follow, but it's probably doable with MR. You just have to write the correct key value pairs
n
Basically im keeping count of POs in a dict object, and iterating based on when the PO comes in to allocate the items to the oldest requested sales orders with back ordered items in order to calculate the estimated shipping date. If not available, defaulting to the ATP time