someone just created a sales order with nearly 500...
# suitescript
c
someone just created a sales order with nearly 5000 line items and now the scripts that run on the SO are timing out.....
đź‘€ 1
b
im honestly surprised it didnt run out of points first
c
yeah me too - but this is the error email: Error: SSS_TIME_LIMIT_EXCEEDED
Next problem is how I can allocate the lot numbers for all of those items given that the script obviously won't work and a rewrite in map/reduce won't be quick.
b
not sure why it wouldnt be quick
c
Script is 300 lines long and does a lot.
Map/reduce would also remove the near real-time element of the script. Lot numbers need assigning straight after the SO is saved as it needs sending (api) to the 3pl immediately
b
you can probably be lazy and just use the user event script as a custom module
if you add a checkbox to the record to track if the script has run or not (which will also make your search easy), you can have both the user event and map/reduce, which will get you into the User Event Script Best Practices and make A Robust Map/Reduce Script
c
I guess you're referring to: "Mission-critical business logic implemented using user events should be accompanied by a clean–up scheduled script to account for any unexpected errors or misfires."
b
yes
c
where the map/reduce is the 'clean up script'
cool
so I should move most of the logic to a custom module then call that module from the aftgerSubmit and the map/reduce
b
yes
you may not even need to make many changes to your user event if you make your custom module's interface like the after submit entry point's interface
c
yeah hopefully it will mostly be a copy paste job
These order sizes are only happening because of a China expansion - massive market.
Interesting to see what breaks when volume increases.