On its 2019.2 release, NetSuite has made bulk actions APIs generally available. This allows developers to be able to perform an action on multiple record instances of the same type.
The bulk action API has the following N/action Module APIs:
The action.executeBulk(options) executes an asynchronous bulk record action and returns the task ID as a string. This API is supported by both client and server-side scripts. This executes with the governance of 50 usage points.
This API has the following parameters:
The options.params parameter is mutually exclusive to options.condition and options.paramCallback. It includes an array of parameter objects. Each of these objects corresponds to a specific record ID of the record for which the action is to be executed.
The options.condition used to select record IDs of records for which the action is to be executed. Only the action.ALL_QUALIFIED_INSTANCES constant is currently supported.
The options.paramCallback is the name of the function that takes a record ID and returns the parameter object for the specified record ID.
The action.getBulkStatus(options) returns the execution status of action.executeBulk(options). The status is returned as a status object with properties that allow developers to easily create script validations. It does so by requiring an ID of the involved task as a parameter. The task ID is returned by a previous action.executeBulk(options) call.
In conjunction with this, developers may choose to utilize the N/task Module to create record action tasks and place them in the Internal NetSuite scheduling or task queue.
Developers may opt to make us of the above APIs to automate certain actions which would otherwise require the more tedious and time-consuming traditional methods that are currently available in SuiteScript. This would allow for a more seamless and efficient coding practice.
Connect with us!
+44 (0) 1273 805348