how can i get a scheduled suitescript to continue ...
# suitescript
l
how can i get a scheduled suitescript to continue running for more than 1000 search results
n
What do you mean? How do you retrieve more than a thousand? Are you running out of governance trying to process more than a thousand? Not sure what you mean?
l
yea im running out of governance trying to process more than 1k
n
SS1 or 2?
l
2
n
In SS1 you can yield the script and start up again from where you it is about to run out SS2 that's not an option. Without creating some convoluted solution you likely want to move to using a map/reduce. Alternatively as a SuiteLet has a governance of 1k and calling it is (i seem to recall) a cost of 10 you might get away with calling a SuiteLet with a batch of records and let it process them. You'll likely run into trouble doing this if you believe the volume of data is going to get much bigger. Large volumes you are better off usually moving to map/reduce.
s
I have different advice - only reach for map/reduce script if your problem fits the map/reduce pattern. If it doesn't, it's likely simpler to just have your scheduled script reschedule itself - you just need to ensure results already processed are not reprocessed. This is often done by marking records as 'processed' somehow so they drop out of the main search driving the script.
n
Yeah, that too, have to be confident the update to the record marking it as processed has happened before you start the next run but probably a minor risk/consideration.
l
how can i have the script reschedule itself
s
Untitled.ts
80% of the time our scheduled scripts requirements fit nicely into that template. Note it does use NFT but the concept remains the same - process results until you need to reschedule, then reschedule.
l
ty
s
you should also be able to use autoReschedule in isolation if you wish (i.e. not using LazySearch).