Modules

filter

 

Objects/Functions

module (N/action)

SuiteScript 2.0

action.get.promise(options)

{action}.get.promise({recordType: {string*},recordId: {string},id: {string*}}).then(function(response){// DO SOMETHING WITH RESPONSE HERE}, function(error){// DO SOMETHING WITH ERROR HERE});

N/action Module
action.get.promise()
Method Description: Returns an executable record action for the specified record type asynchronously. If the recordId parameter is specified, the action object is returned only if the specified action can be executed on the specified record instance. The parameters and errors thrown for this method are the same as those for action.get(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.get.promise(options)

Example:

// Code Example 1
// Add additional code
//...
actionMod.get.promise({recordType: 'timebill', id: 'approve'}).then(function(action) {
// do something with the action object
});
//...
// Add additional code

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