Series Object Members in NetSuite SuiteScript

The Series object in NetSuite SuiteScript defines chart series with aspects and is used for creating visual data representations.

·2 min read·View Oracle Docs

The Series object in NetSuite SuiteScript is crucial for developers working with the workbook API to visualize data through charts. Understanding its members and how to interact with them is essential for efficient data presentation.

What is the Series Object?

The Series object represents a series within a workbook, primarily used to define chart elements. It allows developers to manage the aspects of the series effectively.

Series Object Members

The following table summarizes the available members for the workbook.Series object:

Member NameTypeDescriptionSupported Script Types
Series.aspectsstringAspects for the series.Server scripts

How to Create a Series

To create a Series object, you can use the workbook.createSeries(options) method. Below is an example demonstrating the creation and retrieval of a Series object:

suitescript
1// Add additional code
2...
3// Create a Series
4var mySeries = workbook.createSeries({
5 aspects: [myAspect]
6});
7
8// View a workbook.Series used in a Chart
9var myWorkbook = workbook.load({
10 id: myWorkbookId
11});
12
13var mySeries = myWorkbook.charts[0].series[0];
14
15log.audit({
16 title: 'Series.aspects = ',
17 details: mySeries.aspects[0]
18});
19...
20// Add additional code

Error Handling

It’s important to note that if a wrong parameter type is specified, particularly for the aspects property, an error will be triggered. The relevant error code is:

  • WRONG_PARAMETER_TYPE: Thrown if the value specified is not a workbook.Aspect[].

Related Documentation

For more clarity on operations or further exploration, refer to:

Key Points

  • The Series object is used within the workbook for chart definition.
  • The aspects property specifies the specific attributes of the series.
  • Proper parameter handling is essential to avoid runtime errors.

Frequently Asked Questions (4)

How can I create a Series object in SuiteScript?
To create a Series object, use the `workbook.createSeries(options)` method. You need to pass the necessary options, such as `aspects`, to properly define the series.
What happens if I specify a wrong parameter type for the aspects property?
If a wrong parameter type is specified for the `aspects` property, an error with the code `WRONG_PARAMETER_TYPE` will be triggered, indicating that the value should be a `workbook.Aspect[]`.
Which script type supports the Series.aspects member?
The `Series.aspects` member is supported in server scripts within NetSuite.
Is the Series object used outside of chart definitions?
Within the context of the article, the Series object is primarily used in workbooks to define chart elements, focusing on visual data representation.
Source: Series Object 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 Projects

View all Projects articles →