N/ui/serverWidget Module for Suitelet UI Customization

N/ui/serverWidget module enables Suitelets to build custom UI components like forms, fields, and sublists in NetSuite.

·3 min read·View Oracle Docs

The N/ui/serverWidget module provides developers with tools to create and manage user interface components within NetSuite. Using Suitelets, you can design custom forms, fields, sublists, and wizards that adhere to the NetSuite aesthetic. This capability enhances user experience by enabling tailor-made interactions and functionalities.

Accessing the NetSuite UI

A key point to remember is that SuiteScript does not allow direct manipulation of the NetSuite UI through the Document Object Model (DOM). Instead, you should exclusively utilize the SuiteScript APIs to interact with the UI components.

When adding UI objects to existing NetSuite pages, ensure that any internal IDs referencing these objects are prefixed with custpage to avoid name conflicts.

Module Members Overview

The N/ui/serverWidget module encompasses various objects and methods that can be employed to enhance user interfaces. Here’s a brief overview of its members:

Member TypeNameReturn Type / Value TypeSupported Script TypesDescription
ObjectserverWidget.AssistantObjectSuiteletsA scriptable, multi-step NetSuite assistant.
ObjectserverWidget.ButtonObjectSuitelets and beforeLoad user eventsA button that appears in a UI object.
ObjectserverWidget.FieldObjectSuitelets and beforeLoad user eventsA standard field in NetSuite.
ObjectserverWidget.FormObjectSuitelets and beforeLoad user eventsA basic form template.
ObjectserverWidget.SublistObjectSuitelets and beforeLoad user eventsA sublist for detailed entries.
MethodserverWidget.createForm(options)serverWidget.FormSuiteletsCreates and returns a new form object.
MethodserverWidget.createList(options)serverWidget.ListSuiteletsCreates a new list object.

Important Notes

  • Be cautious when naming your objects to prevent conflicts with existing names.
  • Take advantage of the various objects available in this module to create a cohesive user experience.

The flexibility of the N/ui/serverWidget module allows developers to streamline their custom Suitelet solutions and provide intuitive interactions within NetSuite, resulting in enhanced productivity and user satisfaction.

Key Methods and Properties Some additional important methods and properties include:

  • Assistant Methods: Such as Assistant.addField() and Assistant.addStep() for building out the assistant flow.
  • Field Methods: For manipulating fields such as Field.addSelectOption() to dynamically add choices to dropdowns.
  • Form Methods: Such as Form.addSublist() to include detailed records directly within forms.

Implement these tools and methods strategically to maximize the effectiveness of your Suitelets.

Key Takeaways:

  • The N/ui/serverWidget module empowers developers to create custom UI elements in Suitelets without DOM access.
  • Remember to use custpage as a prefix for internal IDs to avoid conflicts.
  • Utilize the various objects and methods to enhance user interactions within the NetSuite environment.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

Does the N/ui/serverWidget module allow manipulating the NetSuite UI directly through the DOM?
No, the N/ui/serverWidget module does not allow direct manipulation of the NetSuite UI through the DOM. You should use the SuiteScript APIs to interact with UI components.
What is the recommended prefix for internal IDs when adding UI objects to avoid conflict in NetSuite?
It is recommended to prefix any internal IDs with 'custpage' to avoid conflicts with existing names when adding UI objects to NetSuite pages.
Can serverWidget.Button be used in both Suitelets and user events?
Yes, the serverWidget.Button object can be used in Suitelets and beforeLoad user events to add buttons to UI objects.
Which method is used to create a new form object in the N/ui/serverWidget module?
The serverWidget.createForm(options) method is used to create and return a new form object in Suitelets using the N/ui/serverWidget module.
Source: N/ui/serverWidget Module Members Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in User Interface

View all User Interface articles →