SuiteQL Object Members for NetSuite Scripting

SuiteQL provides object members for querying data in NetSuite, enhancing script capabilities across client and server scripts.

·3 min read·1 views·View Oracle Docs

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 NameTypeReturn Type/Value TypeSupported Script TypesDescription
SuiteQL.run()Methodquery.ResultSetClient and server scriptsExecutes the SuiteQL query and returns query results.
SuiteQL.runPaged(options)Methodquery.PagedDataClient and server scriptsOperates the SuiteQL query in a paged fashion for efficient data retrieval.
SuiteQL.columnsPropertyquery.Column[]Client and server scriptsSpecifies the columns to be returned from the query results.
SuiteQL.paramsProperty`stringnumber` (read-only)Client and server scripts
SuiteQL.queryPropertystring (read-only)Client and server scriptsContains the string representation of the SuiteQL query.
SuiteQL.typePropertystring (read-only)Client and server scriptsIndicates 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.

javascript
// 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.

javascript
// 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 and runPaged() for pagination.
  • Supports both client and server scripts, enhancing versatility.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

Do I need to activate any feature to run SuiteQL queries without record limits?
Yes, if the SuiteAnalytics Connect feature is activated, there is no limit on the returned results for SuiteQL queries. Otherwise, the maximum is 100,000 records.
How can SuiteQL queries be managed when dealing with large datasets in NetSuite?
For large datasets, use the `SuiteQL.runPaged(options)` method to handle results in manageable pages, specifying a page size to efficiently retrieve data.
Are SuiteQL object members available in both client and server scripts?
Yes, SuiteQL object members such as `run()`, `runPaged()`, `columns`, `params`, `query`, and `type` are supported in both client and server scripts, providing flexibility in various environments.
What type of object does the SuiteQL.run() method return in NetSuite?
The `SuiteQL.run()` method executes the query and returns the results as a `query.ResultSet` object.
Source: SuiteQL 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 Integration

View all Integration articles →