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 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.
Source: This article is based on Oracle's official NetSuite documentation.
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 User Interface
- NetSuite 360 Redesign Features Enhanced Interface
NetSuite 360's redesigned interface includes new dashboards, payment methods, and improved account management tools for global users.
- Print to File Feature in NetSuite 2026.1
Print to File in NetSuite 2026.1 enhances document management for efficient mobile printing.
- Open Scanned Vendor Bills in NetSuite 2026.1
Access and manage scanned vendor bills efficiently in NetSuite 2026.1. Learn how to streamline your document management.
- Bill Capture Enhancements in NetSuite 2026.1
Bill Capture enhancements in NetSuite 2026.1 boost efficiency with automated data extraction and improved UI for vendor management.
Advertising
Reach User Interface Professionals
Put your product in front of NetSuite experts who work with User Interface every day.
Sponsor This Category