ANS-0822 · SUITESCRIPT DEVELOPMENT

How to Access Item Sublist Line IDs in NetSuite After Submit User Event?

When items are added to a record using the 'Add Multiple' button, the item sublist line IDs are not directly accessible in an After Submit User Event, requiring a record reload.

Short answer

In a NetSuite After Submit User Event, when items are added via the 'Add Multiple' button, the sublist line IDs are not immediately available. To access these line IDs, the record must be reloaded using its record ID. This workaround ensures that all item sublist line IDs become accessible for further processing or validation within the script.

Scenario

A NetSuite User Event script configured to run After Submit may encounter an issue when attempting to access item sublist line IDs. This occurs specifically when items are added to a record using the 'Add Multiple' button. In such cases, the line IDs for the newly added items are not directly available within the script's context, unlike when items are added individually.

Solution

To access item sublist line IDs when items have been added using the 'Add Multiple' button in an After Submit User Event, a workaround is required. The script must explicitly load the record using its record ID. Once the record is reloaded, the item sublist line IDs will become accessible, allowing the script to process them as needed.

Expert NetSuite Support

Need help with this NetSuite issue?

SuiteScript Development consulting and configuration support

Talk to a consultant