N/dataset Module Members Reference for SuiteScript 2.1
Comprehensive reference on N/dataset module members to aid SuiteScript developers in effective dataset management.
The N/dataset module provides a variety of objects and methods essential for creating and manipulating datasets in SuiteScript. Understanding its members can greatly enhance your ability to work with SuiteAnalytics data effectively.
What are N/dataset Module Members?
The N/dataset module contains several key members that facilitate the management of datasets, including the definition of columns, conditions, and the creation of dataset objects. Here’s a concise overview of these members:
| Member Type | Name | Return Type / Value Type | Supported Script Types | Description |
|---|---|---|---|---|
| Object | dataset.Column | Object | Server scripts | Represents a column in the dataset, typically corresponding to a record field. |
| Object | dataset.Condition | Object | Server scripts | Defines a condition or set of conditions to apply to a dataset column. |
| Object | dataset.Dataset | Object | Server scripts | Represents the entire dataset, encompassing its columns, conditions, and joins. |
| Object | dataset.Join | Object | Server scripts | Represents a joined record utilized in the dataset. |
| Method | dataset.create(options) | dataset.Dataset | Server scripts | Creates a new dataset. |
| Method | dataset.createColumn(options) | dataset.Column | Server scripts | Creates a new column for the dataset. |
| Method | dataset.createCondition(options) | dataset.Condition | Server scripts | Creates a condition to be used in the dataset. |
| Method | dataset.createJoin(options) | dataset.Join | Server scripts | Establishes a join for the dataset. |
| Method | dataset.describe(options) | Object[] | Server scripts | Retrieves descriptive information about a dataset, including columns and their properties. |
| Method | dataset.list() | Object[] | Server scripts | Lists all existing datasets available. |
How Do You Use N/dataset Members?
Understanding how to work with dataset members can significantly streamline data manipulation in SuiteScript. Below are example syntax usages for creating columns and conditions:
Creating a Column
// Create a general columnvar myFieldColumn = dataset.createColumn({ fieldId: 'name', id: 7});Creating a Condition
1// Create a condition with an operator2var myCondition = dataset.createCondition({3 column: myNameColumn,4 operator: query.Operator.EQUAL,5 values: ['smith']6});Key Considerations
- Make sure to replace ID values with those that are valid for your specific NetSuite account when working with datasets.
- Review the SuiteScript 2.x Script Types documentation to understand the limitations and supported features within server scripts.
In Summary
The N/dataset module plays a crucial role for developers aiming to leverage SuiteAnalytics datasets effectively. Its structured approach facilitates diverse operational needs, contributing to enhanced data queries and reporting capabilities within NetSuite.
Frequently Asked Questions (4)
Do I need to enable any specific feature flag to use the N/dataset module in SuiteScript?
What types of scripts support the use of dataset members such as Column, Condition, and Join?
Can the N/dataset module be used for client scripts, or is it limited to server scripts only?
What happens if I use an invalid ID value when creating a dataset Column or Condition?
Was this article helpful?
More in SuiteScript
- Common SuiteScript Errors and Solutions for NetSuite
Common NetSuite script errors include INVALID_SCRIPT_DEPLOYMENT_ID and SSS_AUTHORIZATION_HEADER_NOT_ALLOWED. Learn effective solutions.
- Setting Field Values in SuiteScript for Effective Record
Learn to set field values in SuiteScript effectively, troubleshooting common errors and understanding data types.
- SuiteScript 2.1 Enhancements and API Updates in NetSuite
SuiteScript 2.1 enables execution of 2.0 scripts and supports PATCH method for enhanced API capabilities.
- Enhancements to SuiteScript User Role Context Clarification
SuiteScript updates clarify the user and role contexts for script executions, improving deployment understanding and management.
Advertising
Reach SuiteScript Professionals
Put your product in front of NetSuite experts who work with SuiteScript every day.
Sponsor This Category