ANS-1410 · CUSTOM FIELDS, RECORDS & FORMS

Automating Multi-Select Field Values in NetSuite Workflows

Learn how to overcome NetSuite workflow limitations by using a saved search and a custom field to populate multi-select fields with multiple values.

Short answer

NetSuite workflows often fail to populate multi-select fields from saved searches, capturing only the first value. To populate multiple selections, aggregate Internal IDs into a comma-separated string using a saved search. Then, format this string with REPLACE({custfield}, CHR(5)) and temporarily map it through a custom workflow field, initially multi-select then free-form text, before setting the target multi-select field.

Scenario

Standard NetSuite workflow 'Set Field Value' actions are designed for single-value fields. When attempting to populate a multi-select field using a saved search, the workflow typically fails because it only retrieves the first row of the search results. To successfully select multiple options, NetSuite requires a single, comma-separated string of Internal IDs.

Solution

To successfully populate a multi-select field with multiple values from a saved search, a specific approach is required. This involves using a saved search to aggregate the necessary Internal IDs, formatting them into a single comma-separated string, and then leveraging a custom workflow field to bypass UI restrictions. The custom workflow field is temporarily configured as Multi-Select, then switched to Free-form text after the formula is saved, allowing the workflow to accept the multi-value string before it is applied to the target multi-select field.Follow these steps to implement the solution:

  1. Create a saved search that includes the criteria for entities intended for the multi-select field on transactions. In the results, create a formula(text) like:

LISTAGG(DISTINCT {internalid}, ',')WITHIN GROUP(ORDER BY {internalid})

Group this by maximum. This formula will retrieve the internal IDs of the entities matching your criteria.

  1. Create a custom field (e.g., a dropdown) on the transaction that the saved search will use as its filter criteria to dynamically populate the string of Internal IDs.

  2. Create a custom workflow state field of type List/Record with 'Store Value' enabled.

  3. Add a 'Set Field Value' action to the same workflow state. This action should utilize the formula

REPLACE({custfield}, CHR(5))

to populate the workflow state field with the values generated from Step 2.

  1. The workflow state field will not populate correctly at this stage. Go back and edit the workflow state field, changing its type to 'Free-form text'.

  2. Create a custom transaction body field that is of type 'Multi-Select'.

  3. Add another 'Set Field Value' action to the workflow. This action will set the new multi-select field (created in Step 6) to the values stored in the workflow state field (from Step 5).

Expert NetSuite Support

Need help with this NetSuite issue?

Custom Fields, Records & Forms consulting and configuration support

Talk to a consultant