Overview of Record Action and Macro API

NetSuite records offer two alternatives for executing native NetSuite logic: a user either clicks a UI button or runs a script that calls the API corresponding to the button. These script and UI alternatives both produce the same results. Macro and action APIs provide ease and flexibility for your scripting. These APIs are supported for all SuiteScript 2.0 client and server script types. Macro and action APIs also can lower governance usage because they can execute complex business logic in one API call instead of multiple API calls. For actions, governance is charged per individual action executed and varies depending on the type of action. For macros, no governance is charged, because changes executed by macros are saved as part of record submits.

You need to use two different types of APIs to call record macros and actions in your scripts:

  • Generic APIs to get and execute actions or macros:
  • Record action APIs are part of the N/action Module. They include generic members for getting and executing actions on a record type. For details, see N/action Module.
  • Record macro-APIs are part of the N/record Module. They include generic members for getting and executing macros on a record type. For details, see Record Object Members and Macro Object Members.
  • Individual APIs that implement specific logic on a specific record type:
  • A limited number of Individual actions for specific record types are supported. For details, see Supported Record Actions.
  • A limited number of individual macros for specific record types. For details, see Supported Record Macros.

Supported Record Macros

  • Record macros provide an automated way to execute business logic on a record as it is edited.
  • For example, the Recalculate button in the record Billing Rate Card is a record macro.
  • Also, in the sales order, when the items are added, the tax amount is calculated. This is also an example of macro-operation.

Supported Record Actions

  • Record actions provide a convenient way to update the state of one or more records that are in view mode.
  • For example, the approve, reject, submit buttons in the Timesheet are record actions.

Leave a comment

Your email address will not be published. Required fields are marked *