Modules

filter

 

Objects/Functions

module (N/action)

SuiteScript 2.0

action.execute.promise(options)

{action}.execute.promise({recordType: {string*},id: {string*},params: {}).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 record action asynchronously. 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. 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
Sibling Object Members: N/action Module 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
//...
actionMod.execute.promise({id: 'note', recordType: 'timebill', params: {recordId: 1}}).then(function(result) {
// do something with the result
});
//...
// Add additional code

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