Modules

filter

 

Objects/Functions

module (N/search)

SuiteScript 2.0

search.ResultSet

// Please search https://system.netsuite.com/app/help/helpcenter.nl?search=search.ResultSet for more information.

N/search Module
search.ResultSet
Object Description: Encapsulates a set of search results returned by Search.run(). Use the methods and properties for the ResultSet object to iterate through each result returned by the search or access an arbitrary slice of results. The maximum number of results in a ResultSet object is 4000. If a search matches more than 4000 results, you must use Search.runPaged(options) or Search.runPaged.promise(options) to retrieve the full set of results. For a complete list of this object’s methods and properties, see ResultSet Object Members. Search result sets are not cached. If records applicable to your search are created, modified, or deleted at the same time you are traversing your result set, your result set may change.
Supported Script Types: All script types For more information, see SuiteScript 2.0 Script Types.
Module: N/search Module
Since: 2015.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=search.ResultSet

Example:

// Code Example 1
// Add additional code
//...
// Load a saved search. Alternatively, you can create a search using search.create(options)
// and other methods in the N/search module.
var mySearch = search.load({
id: 'customsearch_my_cs_search'
});

// Run the search, and use ResultSet.each(callback) to define a callback function to
// execute on each search result.
//
// In this example, the saved search that was loaded above searches for Customer records.
// The Result.getValue(options) method obtains the search result value of one of the search
// columns that was specified in the search definition. Both 'entityid' and 'email' are valid
// search column names for a Customer record.
mySearch.run().each(function(result) {
var entity = result.getValue({
name: 'entityid'
});
log.debug(entity);

var email = result.getValue({
name: 'email'
});
log.debug(email);

return true;
});
//...
// Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4345767679.html