FieldGroup Object Members in SuiteScript 2.1 Reference
The FieldGroup object in SuiteScript 2.1 manages UI field groups and their properties in NetSuite Suitelets.
The FieldGroup object is a critical component of the NetSuite SuiteScript 2.1 framework, specifically designed for managing field groups within Suitelets. This object allows developers to define how groups of fields behave in the user interface (UI), including features like collapsibility and visibility.
Key Properties of FieldGroup Object
| Property Name | Property Type | Description |
|---|---|---|
isBorderHidden | Boolean | Determines if a border appears around the field group. |
isCollapsible | Boolean | Indicates whether the field group can be collapsed. |
isCollapsed | Boolean | Defines if the field group is displayed collapsed by default. |
isSingleColumn | Boolean | Controls whether the field group is shown in a single column layout. |
label | string | The label that represents the field group in the UI. |
Practical Tips
- Naming Conventions: It's recommended to prefix custom UI elements with
custpageto avoid internal naming conflicts. - UI Consistency: Utilize the
FieldGroupto maintain a coherent layout for user inputs, improving usability and ease of navigation.
Example Usage
Here's an example of how to define and use a FieldGroup in a Suitelet:
1function onRequest(context) {2 var form = serverWidget.createForm({title: 'Sample Form'});3 var fieldGroup = form.addFieldGroup({id: 'custpage_sample_group', label: 'Sample Field Group'});4 5 // Set properties6 fieldGroup.isCollapsible = true;7 fieldGroup.isCollapsed = false;8 9 // Add fields to the group10 form.addField({id: 'custpage_field1', type: serverWidget.FieldType.TEXT, label: 'Field 1'});11 form.addField({id: 'custpage_field2', type: serverWidget.FieldType.TEXT, label: 'Field 2'});12 13 context.response.writePage(form);14}Conclusion
Using the FieldGroup object effectively enhances the usability of custom Suitelets. By defining clear grouping logic and leveraging its properties, developers can create intuitive interfaces that align with NetSuite's user experience standards.
Who This Affects
This content is particularly relevant for:
- Developers: who are designing user interfaces using Suitelets.
- Administrators: who may need to define custom forms and workflows.
Key Takeaways
- The
FieldGroupobject allows for customizable field grouping in Suitelets. - Key properties include
isBorderHidden,isCollapsible, andlabel. - Following naming conventions helps minimize conflicts within the UI.
Frequently Asked Questions (4)
Do I need to prefix custom FieldGroup IDs with 'custpage' in SuiteScript 2.1?
Can a field group be displayed collapsed by default in Suitelets?
Is it possible to hide the border around a FieldGroup in Suitelet?
How can I arrange fields in a single column layout within a FieldGroup in Suitelets?
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.
