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
- 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.
- Set Sublist Field Values in SuiteScript 2.x for Record Management
Set sublist field values in SuiteScript 2.x for effective record management using standard and dynamic modes.
- 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.
Advertising
Reach SuiteScript Professionals
Put your product in front of NetSuite experts who work with SuiteScript every day.
Sponsor This Category