module function · N/redirect
toRecord()
redirect.toRecord(options)
Redirects to a NetSuite record.
- Implementation
- Implemented in the compiler, not yet published
- Design
- Accepted
redirect [edit] record
1redirect.toRecord({2 id: /* string, required */,3 type: /* string, required */,4 isEditMode: /* boolean, optional */,5 parameters: /* Object, optional */6});
| Parameter | Type | Required | Description |
|---|---|---|---|
| options.id | string | required | The internal id of the target record. |
| options.type | string | required | The type of record. |
| options.isEditMode | boolean | optional | Determines whether to return a URL for the record in edit mode or view mode. If set to true, returns the URL to an existing record in edit mode. The default value is false - returns the URL to a record in view mode. |
| options.parameters | Object | optional | Contains additional URL parameters as key-value pairs. |
Supported syntax · compiles today
redirect edit customer
1redirect.toRecord({2 type: record.Type.CUSTOMER,3 id: customer.id,4 isEditMode: true5});
Any record identity is a target: a reference such as Customer(123), a loaded or context record, or a row. edit comes before the target; without it the record opens in view mode. Only in afterSubmit, where NetSuite honours redirects among Mynt's entry points; elsewhere it is an error. In the compiler, not yet published: npm 0.1.0 does not have it. Verified with mynt build on 13 Oct 2026.
Competing syntax for toRecord, from GitHub Discussions. Select two or more to compare them side by side, with the syntax Mynt supports today as a baseline.
redirect edit customerLoading 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?