Custom Action
Use the Custom action to define an action with a SuiteScript Workflow Action script. The SuiteScript script will define the Custom action's behavior. Therefore, to use a Custom action in a workflow, first you will need to develop and deploy a SuiteScript Workflow Action script.
For information about SuiteFlow Workflow Action scripts and to see sample code, see SuiteScript 2.x Workflow Action Script Type.
To create a custom action
-
Create and deploy a Workflow Action script to define the action's functionality.
-
In the Workflow Manager, create a new action. The custom action only appears if the Workflow Action script was deployed for the base record type of the workflow. Workflow Action scripts display in the New Action's Type section with the (Custom) identifier:
Workflow definitions require a trigger configuration that initiates the workflow, executes an action within a workflow or transitions the workflow from one state to another.
-
For more information about which workflow triggers the Custom action supports, see Workflow Triggers Quick Reference.
-
To understand when different workflow triggers execute and which trigger you should use, see Workflow Triggers and the SuiteFlow Trigger Execution Model.
Custom Action Parameters
The following table describes the Custom action parameters:
Parameter |
Description |
---|---|
Store Result In |
A workflow or state field where you can store the Workflow Action script return value. To use this option you must first create the workflow or state field. See Workflow Custom Fields |
Field |
Parameter fields that are defined in the Workflow Action script deployment record. Here you can assign values to these fields so you can access them in the Workflow Action script using the SuiteScript N/runtime module. For more information, see N/runtime Module. |
For more information about adding actions to a workflow, including common action properties and conditions, see Action Conditions and Creating an Action.
Custom Action Guidelines
Use the following guidelines when working with Custom actions:
-
For a Custom action to be available to all workflows, set the Applies To field on the deployment record of the Workflow Action script to All Records.
-
Custom actions are skipped in workflows initiated by users not included in the custom script’s audience. The skipped action scripts are listed in the Workflow Execution Log.
-
For an example where a return value form a Wokflow Action script is stored in a workflow field, see Storing a Return Value from a Custom Action Script in a Workflow Field.