Legend Object Members for SuiteScript Workbook Integration
Understand the properties of the Legend object in SuiteScript for workbooks, including axes and sort definitions.
The Legend object in SuiteScript provides several members that are essential for charting within workbooks. These members allow developers to manage chart axes, data dimensions, and sort definitions, enhancing visual data representation and analysis.
What Members Does the Legend Object Include?
The Legend object provides the following key members:
| Member Name | Type | Supported Script Types | Description |
|---|---|---|---|
Legend.axes | workbook.ChartAxis[] | Server scripts | Represents the axes of the legend. |
Legend.root | workbook.DataDimension | workbook.Section | Server scripts | Refers to the section or data dimension for the Y-axis. |
Legend.sortDefinitions | workbook.SortDefinition[] | Server scripts | Contains the sort definitions associated with the legend. |
Error Handling
When working with properties of the Legend object, be aware of potential errors:
- Error Code:
WRONG_PARAMETER_TYPE- Thrown If: The value specified for a property is not a valid
workbook.ChartAxis.
- Thrown If: The value specified for a property is not a valid
Code Sample
Below is an example to demonstrate how you might access the Legend.axes member of a workbook:
1// Add additional code2...3// View Legend.axes in a Chart4var myWorkbook = workbook.load({5 id: myWorkbookId6});7 8log.audit({9 title: 'Legend.axes = ',10 details: myWorkbook.charts[0].legend.axes11});12...13// Add additional codeThis example illustrates the syntax to access and log the legend axes of a chart within a workbook, enhancing your ability to customize data visualizations in NetSuite.
Additional Context
For more detailed implementations, consider referring to the N/workbook Module, where further examples and complete scripts are available.
Related Resources
- [N/workbook Module]: This module includes additional properties and methods related to workbook functionalities in SuiteScript.
- [SuiteScript 2.x Script Types]: An overview of various script types supported in SuiteScript, critical for understanding the context of the Legend object usage.
Source: This article is based on Oracle's official NetSuite documentation.
Key Takeaways
- The Legend object in SuiteScript provides essential members for charts.
- Key members include axes, root dimensions, and sort definitions.
- Proper error handling is crucial when dealing with object properties.
- Accessing Legend properties enhances the customization of data visualizations.
Frequently Asked Questions (4)
Does the Legend object support client scripts in SuiteScript?
What should I be careful of when working with Legend object properties?
Can Legend.axes represent multiple axes in a chart?
Is there an example of how to access the Legend.axes member in a script?
Was this article helpful?
More in General
- Payment Date Prediction Feature in NetSuite
Payment Date Prediction in NetSuite utilizes machine learning to enhance financial planning by predicting invoice payment dates.
- NetSuite Ship Central Enhancements for Packing & Shipping
NetSuite Ship Central features enhance packing and shipping operations for improved efficiency and accuracy.
- New Role Setup for NetSuite AI Connector Service in 2026.1
The 2026.1 release adds a new role requirement for the NetSuite AI Connector Service, streamlining custom tool development.
- Generative AI Features in NetSuite 2026.1
Discover new generative AI features in NetSuite 2026.1, enhancing reporting, search, predictions, and development productivity.
Advertising
Reach General Professionals
Put your product in front of NetSuite experts who work with General every day.
Sponsor This Category