action.executeBulk(options)
Method Description |
Executes an asynchronous bulk record action and returns its task ID for status queries with action.getBulkStatus(options). The |
Returns |
string |
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
50 units |
Module |
|
Sibling Object Members |
|
Since |
2019.1 |
Parameters
The options parameter is a JavaScript object. 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 recordId
.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
string |
required |
The record type. For a list of record types, see record.Type. |
|
string |
required |
The action ID. |
|
array |
required |
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:
The |
|
string |
optional |
The 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 action.ALL_QUALIFIED_INSTANCES condition only works correctly if the author of the record action has implemented the |
|
string |
optional |
Function that takes 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. |
|
The |
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 handle = action.executeBulk({
recordType: 'timebill',
id: 'approve',
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