action.find.promise(options)

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.

Note:

The parameters and errors thrown for this method are the same as those for action.find(options). For more information about promises, see Promise Object.

Returns

Promise Object

Synchronous Version

action.find(options)

Supported Script Types

Client scripts

For additional information, see SuiteScript 2.x Script Types.

Governance

None

Module

N/action Module

Sibling Object Members

N/action Module Members

Since

2018.2

Parameters

Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

options.recordType

string

required

The record type.

For a list of record types, see record.Type.

options.recordId

string

optional

The record instance ID.

options.id

string

optional

The action ID.

Errors

Error Code

Thrown If

RECORD_DOES_NOT_EXIST

The specified record ID does not exist.

SSS_INVALID_ACTION_ID

The specified action does not exist on the specified record type.

– or –

The action exists, but cannot be executed on the specified record instance.

SSS_INVALID_RECORD_TYPE

The specified record type is invalid.

SSS_MISSING_REQD_ARGUMENT

The options.recordType parameter is missing or undefined.

Syntax

Important:

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
...
var promise = action.find.promise({
    recordType: 'timebill'
});

promise.then(function(actionList) {
    // Process the list of actions
});
...
// Add additional code 

        

Related Topics

N/action Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices