if so, our typical code looks like this ``` lazy.c...
# suitescript
s
if so, our typical code looks like this
Copy code
lazy.createSearch(...search criteria for delete)
.takewhile(governanceRemains)
.each(... do stuff)
and the function
governanceRemains
just checks that say 200 units remain and if not it reschedules the script and returns false. This provides a very clean exit and works with an arbitrarily large number of search results.