Creating and Using State Fields
Workflow Custom Fields and Workflow State Custom Fields can't be used successfully in client-side actions and conditions.
State fields apply to a single state in a workflow. Similar to a workflow field, you use a state field to get and set data in a workflow. NetSuite fills in the field value when the record enters the state. You can use state fields in conditions and actions like the Set Field Value action.
The field stores a unique value for each record where an instance of the workflow runs. You can store the value of the field in the database for each time a record enters the state, or use it temporarily for a single visit to the state by the record in the workflow.
To create a state field, use the Workflow State window or the context panel.
To create a state field:
-
Open the workflow where you want to create the state field.
-
In the diagrammer, select the state in which you want to create the state field, and click New State Field on the Fields view in the context panel.
To edit an state field after you create it, hover over the field name on the Fields view in the context panel, and click the Edit icon.
-
In the Workflow Field window, enter the following properties:
Property
Description
Label
Name or description for the field. NetSuite displays this label in the context panel and in the Store Result In dropdown list on action definition pages.
ID
Optional script ID for the field. This value must be lowercase, can't include spaces, and can't be more than 30 characters.
Use script IDs if you plan to bundle the workflow and install it in another NetSuite account. Script IDs help avoid naming conflicts.
NetSuite prefixes this value with
custwfstate
when you save the workflow definition.Owner
Owner of the state field.
Description
Optional description of the field.
Type
Type of field. See Field Type Descriptions for Custom Fields.
List/Record
List or record that corresponds to the list or record type selected for the Type property.
You must enter a value for this property if you select a List/Record or Multiple Select value for the Type property. See Creating a Custom Field.
Store Value
Stores the field value in the NetSuite database when the record in the workflow enters the state. Use this option if you want the value for future visits to the state by the record in the workflow.
If you don't store the field value, it's accessible only for the current visit to the workflow state.
Workflow
Instances of the workflow this field applies to. You can't edit this field.
-
Set the properties on the Display, Validation & Defaulting, Sourcing & Filtering, and Translation subtabs.
Note:For additional information about custom field properties, see Creating a Custom Field.
-
Click Save. The state field appears on the Fields subtab of the Workflow State window and the Fields view on the State tab on the context panel.
You can now use the field name in a condition or workflow action.