SuiteQL Object Members for NetSuite Scripting
SuiteQL provides object members for querying data in NetSuite, enhancing script capabilities across client and server scripts.
TL;DR
SuiteQL enhances querying capabilities within NetSuite scripts, allowing developers to handle complex data retrieval tasks efficiently. It provides a set of object members for executing SuiteQL queries and retrieving results in both client and server scripts.
What Are SuiteQL Object Members?
SuiteQL is a powerful query language built on the SQL-92 standard that allows users to access NetSuite records and data with advanced querying features. The query.SuiteQL object includes various members that facilitate running and managing queries effectively.
SuiteQL Object Members Overview
The following members are associated with the query.SuiteQL object:
| Member Name | Type | Return Type/Value Type | Supported Script Types | Description |
|---|---|---|---|---|
| SuiteQL.run() | Method | query.ResultSet | Client and server scripts | Executes the SuiteQL query and returns query results. |
| SuiteQL.runPaged(options) | Method | query.PagedData | Client and server scripts | Operates the SuiteQL query in a paged fashion for efficient data retrieval. |
| SuiteQL.columns | Property | query.Column[] | Client and server scripts | Specifies the columns to be returned from the query results. |
| SuiteQL.params | Property | `string | number` (read-only) | Client and server scripts |
| SuiteQL.query | Property | string (read-only) | Client and server scripts | Contains the string representation of the SuiteQL query. |
| SuiteQL.type | Property | string (read-only) | Client and server scripts | Indicates the type of query being executed. |
How to Execute SuiteQL Queries
To run a SuiteQL query, you can utilize methods like SuiteQL.run() and SuiteQL.runPaged(options). Here’s a brief overview of each method:
SuiteQL.run()
This method executes the SuiteQL query and returns the results as a query.ResultSet object. It functions similarly to the query.runSuiteQL(options) method, allowing for seamless integration into existing scripts.
// Example usage of SuiteQL.run()var resultSet = mySuiteQLObject.run();SuiteQL.runPaged(options)
If you are dealing with large datasets, the runPaged method becomes critical for handling results in manageable pages.
// Example usage of SuiteQL.runPaged()var pagedResult = mySuiteQLObject.runPaged({ pageSize: 1000 });Usage Considerations
- If the SuiteAnalytics Connect feature is activated, there's no limit on the returned results. Otherwise, the maximum is 100,000 records.
- These methods support development in both client and server scripts, enhancing flexibility and usability across different environments.
Who This Affects
- Developers: Utilizing SuiteQL for custom queries in their applications.
- Administrators: Managing data retrieval processes and optimizing performance.
Key Takeaways
- SuiteQL enables advanced querying capabilities in NetSuite.
- Essential methods include
run()for standard queries andrunPaged()for pagination. - Supports both client and server scripts, enhancing versatility.
Frequently Asked Questions (4)
Do I need to activate any feature to run SuiteQL queries without record limits?
How can SuiteQL queries be managed when dealing with large datasets in NetSuite?
Are SuiteQL object members available in both client and server scripts?
What type of object does the SuiteQL.run() method return in NetSuite?
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.
