Examples
SuiteScript Search Query
Running a Search Query
SuiteScript search query uses N/search for data retrieval.
Understanding SuiteScript Search Queries
SuiteScript search queries are a powerful feature within NetSuite's SuiteScript API. They allow developers to retrieve data from NetSuite records efficiently using the N/search module. This module provides a way to construct queries that can filter, sort, and join data across various records. Understanding how to use this module is crucial for developers aiming to manipulate and display data within NetSuite applications.
Setting Up a Basic Search Query
To create a basic search query using SuiteScript, you need to use the N/search module. Here's a simple example of how to set up a search to retrieve customer records.
Advanced Filtering Techniques
SuiteScript allows for advanced filtering to refine your search results. You can combine multiple filters using logical operators such as 'AND' and 'OR'. Below is an example of a more complex search query that looks for customers either in a specific state or with a certain credit limit.
Sorting Search Results
Sorting results is a common requirement in data retrieval. With SuiteScript, you can specify the sort order of your search results using the 'sort' property in the search column definition. Here's how you can sort customer records by their credit limit in descending order.
Examples
- Previous
- Custom Record
- Next
- SuiteQL Query