Action.execute(options)

Method Description

Executes the action and returns the action result in a object.

The response property of the result object holds the response returned by the action implementation. The notifications property of the result object is an array of notification objects. It contains the details of errors and warnings that occurred during action execution. 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.

Returns

Object

Supported Script Types

Client and server scripts

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

Governance

None

Module

N/action Module

Parent Object

action.Action

Sibling Object Members

Action Object Members

Since

2018.2

Parameters

Note:

The parameters that are required vary for action types. The only parameter that is always required is options.recordid, unless the action object is qualified. An action object is qualified if it is the result of an action.get() or action.find() call that provides the recordId.

Parameter

Type

Required / Optional

Description

options.Object

Object

required or optional

The parameters that need to be provided depend on the action implementation. See the action help.

options.params.recordId

int

required or optional

The record instance ID of the record on which the action is to be performed.

This is the NetSuite record internal ID.

Errors

Error Code

Thrown If

SSS_MISSING_REQD_ARGUMENT

A required parameter is missing.

Syntax

Important:

The following code snippet shows the syntax for this member. It is not a functional example. For a complete script example, see N/action Module Script Samples.

           // Add additional code
...
var myResult = action.execute({
    recordId: 1
});
...
// Add additional code 

        

Related Topics

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

General Notices