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, ...]
1search.lookupFields({2 type: /* enum, required */,3 id: /* string, required */,4 columns: /* string | string[], required */5});
| Parameter | Type | Required | Description |
|---|---|---|---|
| options.type | enum | required | The search type for which you want to look up fields. Use the search.Type enum for this argument. |
| options.id | string | required | Internal ID for the record, for example 777 or 87. |
| options.columns | string | string[] | required | Array of column/field names to look up, or a single column/field name. The columns parameter can also be set to reference joined fields. |
Supported syntax · compiles today
let email = Customer(123)[email]
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.
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.
let email = Customer(123)[email]Loading proposals from GitHub…
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,saveandRef[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?