Modules

filter

 

Objects/Functions

module (N/action)

SuiteScript 2.0

action.find.promise(options)

{action}.find.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.find.promise()
Method Description: Performs a search for available record actions asynchronously. If only the recordType parameter is specified, all actions available for the record type are returned. If the recordId parameter is also specified, then only actions that qualify for execution on the given record instance are returned. If the id parameter is specified, the only the action with the specified action ID is returned. This method returns a plain JavaScript object of NetSuite record actions available for the record type. The object contains one or more action.Action objects. If there are no available actions for the specified record type, an empty object is returned. If the recordId is specified in this call, the actions that are found are considered qualified. You do not have to provide the recordId to execute a qualified action. The parameters and errors thrown for this method are the same as those for action.find(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.find.promise(options)

Example:

// Code Example 1
// Add additional code
//...
var promise = action.find.promise({recordType: 'timebill'});
promise.then(function(actionList) {
// do something with the list of actions
});
//...
// Add additional code

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