Using Sublist Action Groups
You can run actions on sublist lines as part of a transaction record workflow using Sublist Action Groups. A Sublist Action Group is a group of actions assigned to a workflow state that run on each line of a sublist. Whether actions run during a workflow state depend on the group and group action conditions. The sublist action group runs only if its conditions are met. For the group to process, the group’s condition must evaluate to true.
If the group’s condition is true, the workflow goes through all sublist lines and tries each in the group. If a group action’s condition is true for a sublist line, the action runs on that line. All actions are checked for a sublist line before moving to the next line. After an action is evaluated, the result is immediately considered for the next group actions.
For example, consider a sublist line’s Description field that has a value of Val1. A sublist action group has the two following Set Field Value actions:
-
Set Field Value action 1 sets the sublist line’s Description field value to Val2.
-
Set Field Value action 2 has a condition that it runs if the sublist line’s Description field’s value is Val2.
Both Set Field Value actions run. The first action doesn't have a condition and changes the Description field to Val2. When the second action is checked, it sees the new value and runs next.
You can include the following action types in Sublist Action Groups:
-
Set Field Value. This action lets you set values for record body, custom workflow state, and sublist fields. You can also set values for these fields based on values of the same field types (record body, workflow state, sublist).
-
Create Record. This action lets you create a new record based on record body, custom workflow state, or sublist field values. For example, when a training item is ordered on a sales order record, you can create a task record for the training supplies.
-
Send Email. This action lets you send an email message for each item line. You can use line fields, body fields, workflow and state custom fields in the subject and body of the email message. To access the currently in an email template, use the prefix currentLine.
-
Return User Error. This action returns a user error for the record. You can use line fields, body fields, workflow and state custom fields in the subject and body of the message. Because the action runs on the server, the error appears as a full-page message.
You can use Sublist Action Groups on all server triggers, but not on client triggers. For information about workflow triggers, see Triggers Reference.
There are some things to keep in mind about executing sublist action groups and the actions within them on the Before Load Trigger. For details, see Executing Sublist Action Groups on the Before Load Trigger.
You can use Sublist Action Groups with any workflow definitions created on transaction records, but not on opportunity records. To configure a sublist action group, create the group and then add actions to it.
To configure a sublist action group, first create the group, then add actions. For more information, see Configuring Actions for Sublist Action Groups.
To create a sublist action group:
-
Open in edit mode the existing workflow that contains the state where you want to create a sublist action group.
See Viewing Existing Workflows and Workflow Manager Interface View and Edit Modes.
-
In the diagrammer, select the state and click the Edit icon on the State tab in the context panel.
-
Click New Sublist Group. The Sublist Action Group window appears with the Type field set to Sublist Action Group.
-
In the Workflow Action Group window, enter the following properties for the action group:
Property
Description
Required
Insert Before
Where the action group appears in the current list. Actions with the same trigger type run in the order they appear on the Actions subtab for the state or for action group.
Use this field to reorder actions in the group. See Reordering Actions.
No
Trigger On
Trigger type for this group. This property is required. You can't use sublist action groups on client triggers, only on server triggers.
For more information, see Workflow Triggers and Triggers Reference.
Note:If you change the trigger type for the action group, you get an error if any actions in the group aren't compatible with the new trigger type.
Yes
Event Types
The activity that created, viewed, or updated the record. The actions of the action group run only if this happens.
For example, you can limit the action to run only if a record is copied.
You can select multiple event types.
For more information, see Workflow Event Types and Event Types Reference.
No
Contexts
The NetSuite feature used to create, view, or update the record. The workflow instance starts only if the context is met.
For example, you can initiate the workflow instance only when the record for the workflow is created by a web service. For more information, see Execution Contexts and Execution Context Types.
No
-
To make the group inactive, check the Inactive box. The next time the workflow runs, the actions in the group don't run. Inactive sublist action groups are dimmed in the context panel.
-
To enter a condition for the action group, use the Condition Builder or Formula Builder.
The group runs only if the condition criteria are met. Use a condition to limit when group actions runs, for example, only for a specific user. For more information, see Working with Conditions.
Be aware that sublist action group’s condition can use only record body fields. However,the actions within the sublist action group can use both record body and sublist fields.
-
(Optional) Select a saved search as a condition for action group execution. The actions in the group run if the current record in the workflow is found by the saved search.
The saved search record type must be the same as the base record type for the workflow to appear in the dropdown list. For more information, see Executing an Action with a Saved Search Condition.
-
In the Parameters section of the Sublist Action Group window, the Items sublist is selected in the Sublist dropdown list.
-
(Optional) Enter a schedule. The actions in the group run on the schedule you set, after the record enters the workflow state. For more information, see Scheduling an Action.
-
Click Save. The new group appears in the action list for the state on the Actions subtab. You can also view it on the State tab in the context panel. For details, see Workflow Context Panel.
After you save the new group, you can add actions to it.
Sublist Action Groups work with the Items and the Expense Report Expenses sublists only. You can't use Sublist Action Groups for any other type of sublist.
To add an action to a sublist action group:
-
In the context panel’s State tab, hover over to a sublist action group name. You'll see icons to add, edit, or delete the group from the state.
-
Click the + icon.
-
In the New Action window, click the action type you want to add to the group. You can select from the following actions:
-
Configure the selected action. See Configuring Actions for Sublist Action Groups.
Configuring Actions for Sublist Action Groups
Be aware of the following as you configure actions for your sublist action groups:
-
You can use Items sublist fields in conditions, formulas, and action parameters.
-
Sublist fields appear alphabetically in field lists and have the suffix (Line), such as Item (Line).
-
To reference a body field in a formula, use {fieldid}. For example, the memo body field is referenced with {memo}.
-
To reference a sublist field in a formula, use {line.fieldid}. For example, the description sublist field is referenced with {line.description}.
-
Body fields in conditions and parameters don't have a prefix or suffix.
-
Sublist fields in conditions and parameters ise the prefix Line : . For example:
-
In the action list of the sublist action group, in the Parameters column, parameters are listed in the following format: Line : Description = Line : Item : Store Description .
-
In the action list of the sublist action group, in the Condition column, conditions are listed in the following format: Condition : Line : Description = test.
-
On the Set Field Value action detail page, in the Condition field, conditions are listed in the following format: Condition : Line : Description = test.
-
Executing Sublist Action Groups on the Before Load Trigger
Be aware of the following for sublist action groups and the actions within sublist action groups that are set to trigger on Before Record Load:
-
You can get Items sublist field values on new and existing records with the Before Record Load trigger, for example, to evaluate in a condition.
-
You can set body fields, Items sublist fields, workflow, and state field values on new and copied records with the Before Record Load trigger.
-
You can't set body or Items sublist fields on existing records with the Before Record Load trigger.
-
You can set workflow and state fields on existing records with the Before Record Load trigger.