I have a script that requires me to unapprove time...
# suitescript
t
I have a script that requires me to unapprove time entries, do some calculations then reapprove time entries. I had previously used record.submitFields to update the approval status to perform these tasks in a map reduce script but changed over to using the action module as I thought it would be less prone to error. I sometimes need to approve up to 600 records in a single reduce queue which can exceed governance but the bulkExecute function is asynchronous and only uses 50 governance making it scalable to any required number of time bills. I ran into several cases where time was not reapproved using the bulkExecute function and it appears to be related to volume as anything above 120 records seems to fail to execute fully. In my testing I found I can bulkExecute ~120 time records for approval with any more failing consistently and not running or only partially approving time. When run in smaller batches the same data is approved so it appears to be directly related to volume I'm curious if there is some non documented limit to the number of actions that can be used in the bulkExecute function that I can be told or if there is a way to better use the function. Below is how I'm currently executing it let timeBillIds = [ { recordId: 'XXX' }] // <-- can have up to 600 elements in this array let actionObj = action.get({recordType: 'timebill', id: 'approve'}); let taskId = actionObj.executeBulk({params: timeBillIds}); bulkStatus = action.getBulkStatus({ taskId: taskId}); I'm planning to switch to using a CSV to update the approval status instead as it seems to be more consistent and easier to track from a progress standpoint.