Modules

filter

 

Objects/Functions

module (N/action)

SuiteScript 2.0

Action.execute.promise(options)

{Action}.execute.promise({Object: {Object},}).then(function(response){// DO SOMETHING WITH RESPONSE HERE}, function(error){// DO SOMETHING WITH ERROR HERE});

N/action Module
Action.execute.promise()
Method Description: Executes the action asynchronously and returns the action result in a plain JavaScript object. The action result is returned in an object. The response property of the results object shows the action result. If the action fails, it is listed in the results object’s notifications property. If the action executes successfully, the notifications property is usually empty. If the Action object is qualified (it is a result of an action.get() or action.find() call that provides the recordId), then it is not required to provide a recordId and the options.params.recordId parameter is optional. If options.params.recordId is provided during execution, it takes precedence over the recordId stored in the Action object. The parameters and errors thrown for this method are the same as those for Action.execute(options). For more information on promises, see Promise Object.
Returns: Promise Object
Supported Script Types: Client scripts For additional information, see SuiteScript 2.0 Script Types.
Governance: None
Module: N/action Module
Parent Object: action.Action
Sibling Object Members: Action Object Members
Since: 2018.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=Action.execute.promise(options)

Example:

// Code Example 1
// Add additional code
//...
action.execute.promise({recordId: 1}).then(function(result) { /* process result here */ });
//...
// Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_1509386721.html