Protected
currentProtected
currentProtected
indexProtected
iteratorProtected
logProtected
mappedProtected
pagedStatic
LOGNAMEthe name of the custom logger for this component for independent logging control
LazyQuery is both an iterable and an iterator for query results.
per the iterator protocol, retrieves the next element. Also returns null
if done as the specification for
the protocol says the value property is optional when 'done'
You don't typically call this function yourself - libraries like ImmutableJS do.
Static
fromCreates a lazy query from an existing NS .
the SQL query and optional query parameters
Optional
pageSize: numberoptional pagesize, can be up to 1000. Default is 500
Lazy Seq ready for processing
import {Seq} from './NFT-X.Y.Z/immutable'
import * as query from 'N/query
import {governanceRemains, LazyQuery, nsQueryResult2obj} from './NFT-X.Y.Z/query'
Seq(LazyQuery.from({
query: 'SELECT id FROM FOO WHERE name = ?',
params: ['Farnsworth']
}))
.takeWhile(governanceRemains()) // process until we drop below default governance threshold
.map(nsQueryResult2obj()) // convert query results to plain objects with properties
.forEach( r => log.debug(r))
Makes a NetSuite query an ES2015 style Iterator. That is, it follows the Iterator Protocol for iterating over query results in a forward-only fashion. The result can be passed to any library that accepts Iterators (such as ImmutableJS) to provide easy chainable logic for arbitrary length result sets.
See
LazySearch
Example: take the first result of a query as a plain object (ImmutableJS)