Creating and Using State Fields

Important:

Workflow Custom Fields and Workflow State Custom Fields cannot be successfully used in client-side actions and conditions.

State fields apply to a single state in a workflow. Similar to a workflow field, use a state field to get and set data within a workflow. NetSuite populates the value of the field when the record in the workflow enters the state that contains the state field. You can use the state field in conditions and actions like the Set Field Value action.

The field stores a unique value for each record on which an instance of the workflow runs. You can choose to store the value of the field in the database for access each time a record enters the state, or only 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:

  1. If you have not already done so, open the workflow in which you want to create the state field.

    See Viewing Existing Workflows or Workflow Searches.

  2. 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.

    A portion of the context panel showing the Fields view and the New State Field selected.

    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.

  3. On 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. It cannot include spaces or exceed 30 characters.

    Use script IDs if you plan to use the SuiteBundler feature to bundle the workflow and install it in another NetSuite account. Script IDs reduce the risk of naming conflicts.

    NetSuite prepends custwfstate to this value when you save the workflow definition.

    Owner

    Owner of the state field.

    Description

    Optional text 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 to store the value for future visits to the state by the record in the workflow.

    If you do not store the field value, the value is only accessible in the for the current visit to the workflow state.

    Workflow

    Instances of the workflow to which this field applies. You cannot edit this field.

  4. Continue setting 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.

  5. 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.

Related Topics

Working with Custom Fields
Creating and Using Workflow Fields

General Notices