N/action Module
Use the N/action module to execute business logic to update the state of records in view mode. To execute business logic on records in edit mode, use the record macro APIs, which are included in the N/record Module module. See Record Object Members and Macro Object Members. Action and Macro APIs are the programmatic equivalent to clicking a button in the UI. To learn more, see Overview of Record Action and Macro APIs.
The changes that you make to records with N/action module APIs are persisted in the database immediately. For example, consider the timebill record. After you click the Approve button in the UI, the timebill and its entries are saved in an approved state, and this change is immediately updated in the database.
Governance for action module APIs varies for actions and record types. See the action help for governance information specific to actions and record types.
A limited number of individual actions for specific record types are supported. For details, see Supported Record Actions.
For supported script types, see individual member topics listed below.
In This Help Topic
N/action Module Members
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Object |
Object |
Client and server scripts |
Encapsulates a NetSuite record action. |
|
Plain JavaScript Object |
Object |
Client and server scripts |
A plain JavaScript object of actions available for a record type. |
|
Method |
Object |
Client and server scripts |
Executes the record action and returns action results in an object. |
|
Promise |
Client scripts |
Asynchronously executes the record action and returns the action results in an object. |
||
string |
Client and server scripts |
Executes an asynchronous bulk record action and returns its task ID for later status inquiry. |
||
Object |
Client and server scripts |
Returns a plain JavaScript object of available record actions for the given record type. |
||
Promise |
Client scripts |
Asynchronously returns a plain JavaScript object of available record actions for the given record type. |
||
Client and server scripts |
Returns an executable record action for the given record type. |
|||
Promise |
Client scripts |
Asynchronously returns an executable record action for the given record type. |
Action Object Members
The following members are called on action.Action.
Member Type |
Name |
Return Type/Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Method |
Object |
Client and server scripts |
Executes the action and returns the action results in an object. |
|
Promise |
Client scripts |
Executes the action asynchronously and returns the action results in an object. |
||
Object |
Client and server scripts |
Executes the action and returns the action results in an object. |
||
Promise |
Client scripts |
Executes the action asynchronously and returns the action results in an object. |
||
string |
Client and server scripts |
Executes an asynchronous bulk record action and returns its task ID for later status inquiry. |
||
Object |
Client and server scripts |
Returns the current status of action.executeBulk(options) with the given task ID. |
||
Property |
string |
Client and server scripts |
The action description. |
|
string |
Client and server scripts |
The ID of the action. For a list of action IDs, see Supported Record Actions. |
||
string |
Client and server scripts |
The action label. |
||
Object |
Client and server scripts |
The action parameters. |
||
string |
Client and server scripts |
The type of the record on which the action is to be performed. For a list of record types, see record.Type. |