action.execute.promise(options)
Method Description |
Executes the record action asynchronously. If the action fails, it is listed in the results object’s
Note:
The parameters and errors thrown for this method are the same as those for action.execute(options). For more information about promises, see Promise Object. |
Returns |
|
Synchronous Version |
|
Supported Script Types |
Client scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Sibling Object Members |
|
Since |
2018.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
string |
required |
The record type. For a list of record types, see record.Type. |
|
string |
required |
The action ID. For a list of action IDs, see Supported Record Actions. |
|
Object |
required |
Action arguments. |
|
string |
required |
The record instance ID. This is the NetSuite record internal ID. |
Errors
Error Code |
Thrown If |
---|---|
|
The specified record instance does not exist. |
|
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 sample shows the syntax for this member. It is not a functional example. For a complete promise script example, see Promise Object.
// Add additional code
...
action.execute.promise({
id: 'note',
recordType: 'timebill',
params: {
recordId: 1
}
}).then(function(result) {
// Process the result
});
...
// Add additional code