Adding Sublists with SuiteScript in NetSuite
Add functional sublists to your SuiteScript forms using the serverWidget module's capabilities. TL;DR Opening This article explains how to add sublists to forms
TL;DR Opening
This article explains how to add sublists to forms and assistants in SuiteScript using the serverWidget module. This is crucial for customizing user interfaces in NetSuite, enhancing data entry workflows, and providing better user experiences.
What is a Sublist?
A sublist is a component that can be added to a serverWidget.Form or a serverWidget.Assistant object in NetSuite. It allows you to display and manage related records or information within a form or assistant layout. The sublist can show data such as line items, related records, etc., and improves the usability and layout of forms.
How to Add a Sublist?
To add a sublist, you can use one of the following methods:
- Assistant.addSublist(options)
- Form.addSublist(options)
Note: The sublist object is read-only except when created through Suitelets or beforeLoad user event scripts.
Supported Script Types
Sublists can be used in the following script types:
- Suitelets
- User event scripts (specifically during the beforeLoad entry point)
These types provide flexibility when creating interfaces in NetSuite.
The serverWidget Module
The sublist functionality is part of the N/ui/serverWidget Module. This module allows developers to create and manipulate server-side UI components in SuiteScript.
Example Syntax
The following code snippet demonstrates how to add a sublist to a form:
1//Add additional code 2...3var form = serverWidget.createForm({4 title : 'Simple Form'5});6var sublist = form.addSublist({7 id : 'sublist',8 type : serverWidget.SublistType.INLINEEDITOR,9 label : 'Inline Editor Sublist'10});11...12//Add additional codeThis code illustrates the integration of a sublist with a basic form. The type field illustrates how to define the behavior of the sublist (in this case, an inline editor).
Who This Affects
- Developers: Those looking to customize user interfaces in NetSuite using SuiteScript.
- Administrators: Administrators implementing features that require sublists in Suitelets or forms.
Key Takeaways
- Sublists enhance data management on forms and assistants in NetSuite.
- Utilize the
serverWidgetmodule for all relevant UI customizations. - They can be leveraged in Suitelets and beforeLoad user event scripts only.
- Proper syntax is essential for successful implementation.
Frequently Asked Questions (4)
Which script types support adding sublists using SuiteScript?
Is it possible to modify a sublist after it has been added to a form in SuiteScript?
What module do I use in SuiteScript to add a sublist to a form?
What prerequisites are required to add a sublist to a form using SuiteScript?
Was this article helpful?
More in SuiteScript
- SuiteScript 2.1 Enhancements in NetSuite February Updates
SuiteScript 2.1 now supports async features and PATCH method. Discover the latest API and SuiteProcurement improvements.
- Scheduling Map/Reduce Script Deployments in NetSuite
Learn to schedule map/reduce script submissions, including one-time and recurring options in NetSuite.
- Binary File Support in N/https Module for SuiteScript
SuiteScript enhances capabilities with binary file support in the N/https module, allowing improved data handling in external communications.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
