Action.executeBulk(options)
Method Description |
Executes an asynchronous bulk record action and returns its task ID for status queries with action.getBulkStatus(options). |
Returns |
string |
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
50 units |
Module |
|
Parent Object |
|
Sibling Object Members |
|
Since |
2019.1 |
Parameters
The options.params
array consists of parameter objects. The values that are required in each parameter object vary for action types. The only value that is always required is options.recordId
, unless the action object is qualified. An action object is qualified if it is the result of an action.get()
or action.find()
call that provides the recordId
.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
array |
required |
The An array of parameter objects. Each object corresponds to one record ID of the record for which the action is to be executed. The object has the following form:
|
|
string |
optional |
The condition used to select record IDs of records for which the action is to be executed. Only the The action.ALL_QUALIFIED_INSTANCES condition only works correctly if the author of the record action has implemented the |
|
string |
optional |
the name of the function that takes a record ID and returns the parameter object for the specified record ID. |
Errors
Error Code |
Thrown If |
---|---|
|
The specified action does not exist on the specified record type. – or – The action exists, but cannot be executed on the specified record instance. |
|
The specified record type is invalid. |
|
A required parameter is missing. |
Syntax
The following code snippet shows the syntax for this member. It is not a functional example. For a complete script example, see N/action Module Script Samples.
// Add additional code
...
var actionObj = action.get({
recordType: 'timebill',
id: 'approve'
});
var handle = actionObj.executeBulk({
params: [
{
recordId: 1,
note: 'this is a note for 1'
},
{
recordId: 5,
note: 'this is a note for 5'
},
{
recordId: 23,
note: 'this is a note for 23'
}
]
});
...
// Add additional code