module function · N/search
create()
search.create(options)
Creates a new search and returns it as a search.Search object.
- Implementation
- Implemented published in npm 0.1.0
- Design
- Accepted
search T where ...
A
suitescript api
1search.create({2 type: /* search.Type, required */,3 filters: /* search.Filter | search.Filter [] | Object | Object[] | string | string[], optional */,4 columns: /* search.Column | search.Column [] | Object | Object[] | string | string[], optional */,5 packageId: /* string, optional */,6 settings: /* search.Setting | search.Setting [] | Object | Object[] | string | string[], optional */,7 title: /* string, optional */,8 id: /* string, optional */,9 isPublic: /* boolean, optional */10});
| Parameter | Type | Required | Description |
|---|---|---|---|
| options.type | search.Type | required | The search type that you want to base the search on. |
| options.filters | search.Filter | search.Filter [] | Object | Object[] | string | string[] | optional | A single search.Filter object, an array of search.Filter objects, a search filter expression, or an array of search filter expressions. A search filter expression can be passed in as an Object with the following properties: name (required) join operator (required) summary formula values For more information about these properties, see Filter Object Members . If a provided filter value has an incorrect type (for example, a string instead of a number), the filter value is ignored. For server scripts, a log entry is created when an incorrect type is provided. Note: You can further filter the returned search.Search object by adding additional filters with Search.filters or Search.filterExpression . |
| options.columns | search.Column | search.Column [] | Object | Object[] | string | string[] | optional | A single search.Column object or array of search.Column objects. You can optionally pass in an Object or array of Objects with the following properties to represent a Column: name (required) formula function join label sort summary For more information about these properties, see Column Object Members . |
| options.packageId | string | optional | The application ID for this search. |
| options.settings | search.Setting | search.Setting [] | Object | Object[] | string | string[] | optional | Search settings for this search as a single search.Setting object or an array of search.Setting objects. Search settings let you specify search parameters that are typically available only in the UI. See Search.settings . You can optionally pass in an Object or array of Objects with the following properties to represent a setting: name value For more information about these properties, see Setting Object Members . |
| options.title | string | optional | The name for a saved search. The title property is required to save a search with Search.save() . |
| options.id | string | optional | Script ID for a saved search. If you do not set the saved search ID, NetSuite generates one for you. See Search.id . |
| options.isPublic | boolean | optional | Set to true to make the search public. Otherwise, set to false . If you do not set this parameter, it defaults to false . This parameter sets the value for the Search.isPublic property. |
B
mynt syntax
Supported syntax · compiles today
1let customers = search Customer2 where email !== ""
const customers = mynt$search(search.Type.CUSTOMER, ["email"], [], [["email", search.Operator.ISNOTEMPTY, ""]]);
mynt$search is a helper the compiler emits once per file. It calls search.create with the planned columns and collects every page of runPaged. Published on npm since 0.1.0. Verified with mynt build on 13 Oct 2026.
C
community proposals
Competing syntax for create, from GitHub Discussions. Select two or more to compare them side by side, with the syntax Mynt supports today as a baseline.
Mynt today
let customers = search CustomerLoading proposals from GitHub…
D
suggest an alternative
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?