Aspect Object Members in SuiteScript for Workbook API
Aspect object members in SuiteScript define measures and types within the Workbook API for effective data handling.
TL;DR Opening
The Aspect object members in SuiteScript facilitate the handling of data measures and types within the Workbook API, enhancing scripting flexibility and data interaction. Understanding these properties is crucial for effective script development.
What is the Aspect Object?
The Aspect object is part of the Workbook API, which allows developers to create and manipulate data visualizations directly in SuiteScript. By utilizing the Aspect object, you can define specific data measures and types necessary for your workbook operations.
What Members Does the Aspect Object Include?
The Aspect object includes several key members:
| Member Name | Type | Return Type / Value Type | Supported Script Types | Description |
|---|---|---|---|---|
| Aspect.measure | workbook.CalculatedMeasure or workbook.DataMeasure | Measure of the aspect. | Server scripts | Represents the measurement aspect of the object. |
| Aspect.type | string | The type of the aspect. | Server scripts | Specifies the kind of aspect using workbook.AspectType. |
Syntax for Creating an Aspect
To create an Aspect object, you can utilize the following code structure, which highlights both basic and complete examples:
1// Create a basic Aspect2var myAspect = workbook.createAspect({3 measure: myMeasure,4});5 6// Create a complete Aspect7var myAspect = workbook.createAspect({8 measure: myMeasure,9 type: workbook.AspectType.COLOR10});How to Access Aspect Members
After creating an Aspect object, it’s possible to access its various properties, as shown here:
1// Load a workbook and view an aspect in a Chart2var myWorkbook = workbook.load({3 id: myWorkbookId4});5var myAspect = myWorkbook.charts[0].series[0].aspect[0];6 7log.audit({8 title: 'Aspect type = ',9 details: myAspect.type10});11log.audit({12 title: 'Aspect measure = ',13 details: myAspect.measure14});Error Handling
When working with the Aspect members, be aware of the following error code that may be thrown:
- WRONG_PARAMETER_TYPE: This error occurs if the provided value for
Aspect.measureis not of typeworkbook.CalculatedMeasureorworkbook.DataMeasure.
Who This Affects
- Developers: Ensures they can effectively utilize the Workbook API to create dynamic reports.
- Administrators: Assists in managing workbook creation and data visualization tasks efficiently.
Key Takeaways
- The Aspect object enhances data handling within the SuiteScript Workbook API.
- Key properties include
measureandtype, defining how data is represented. - Error handling is crucial for preventing incorrect data types during variable assignments.
Frequently Asked Questions (4)
What script types support the Aspect object in SuiteScript?
What error might occur when working with Aspect.measure, and how can it be avoided?
Can an Aspect object have both measure and type properties defined?
How do I access an Aspect object's properties in a SuiteScript workbook?
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