module function · N/search

lookupFields()

search.lookupFields(options)

Performs a search for one or more body fields on a record.

Implementation
Implemented published in npm 0.1.0
Design
Accepted Ref[field, ...]
Proposals
A
Signature
search.lookupFields(options)
Module
N/search
Returns
Object | array
Governance
1 unit
Script types
Client and server scripts
Version
SuiteScript 2.x, documented for 2.1; since NetSuite 2015.2
call shapefrom Oracle's parameter table
1search.lookupFields({2    type:    /* enum, required */,3    id:      /* string, required */,4    columns: /* string | string[], required */5});
Oracle reference for this method
ParameterTypeRequiredDescription
options.typeenumrequiredThe search type for which you want to look up fields. Use the search.Type enum for this argument.
options.idstringrequiredInternal ID for the record, for example 777 or 87.
options.columnsstring | string[]requiredArray of column/field names to look up, or a single column/field name. The columns parameter can also be set to reference joined fields.
B

Supported syntax · compiles today

myntRef[field, ...]
let email = Customer(123)[email]
suitescriptoutput, trimmed
1const email = search.lookupFields({2    type: search.Type.CUSTOMER,3    id: 123,4    columns: ["email"]5}).email;

One call however many fields are listed. Several fields yield a read-only projection with exactly those fields, which let { email, comments } = ... can destructure. Published on npm since 0.1.0. Also written lookup Customer(123)[email] or lookup Customer(123) select email, and destructured with let { ... } =: in the compiler, not yet published. Verified with mynt build on 13 Oct 2026.

C

Competing syntax for lookupFields, from GitHub Discussions. Select two or more to compare them side by side, with the syntax Mynt supports today as a baseline.

All discussions
Mynt todaylet email = Customer(123)[email]

Loading proposals from GitHub…

D

Write the Mynt you wish you could write.

A good proposal shows the syntax, the SuiteScript it should become, and argues for it: why it is clearer, how it fits the rest of the language, what it makes harder.

  • Clarity. Does it say what happens, without ceremony?
  • Consistency. Does it read like load, save and Ref[field]?
  • Expressiveness. Does it cover the cases people actually write?
  • Honesty. Does it hide a NetSuite cost, such as governance, that a reader should see?

N/search · search.lookupFields(options)

Suggest syntax for lookupFields