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
Proposals
A
Signature
redirect.toRecord(options)
Returns
void
Governance
None
Script types
Suitelets, beforeLoad user events, and synchronous afterSubmit user events
Version
SuiteScript 2.x, documented for 2.1; since NetSuite 2015.2
call shapefrom Oracle's parameter table
1redirect.toRecord({2    id:         /* string, required */,3    type:       /* string, required */,4    isEditMode: /* boolean, optional */,5    parameters: /* Object, optional */6});
Oracle reference for this method
ParameterTypeRequiredDescription
options.idstringrequiredThe internal id of the target record.
options.typestringrequiredThe type of record.
options.isEditModebooleanoptionalDetermines 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.parametersObjectoptionalContains additional URL parameters as key-value pairs.
B

Supported syntax · compiles today

myntredirect [edit] record
redirect edit customer
suitescriptoutput, trimmed
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.

C

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.

All discussions
Mynt todayredirect edit customer

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/redirect · redirect.toRecord(options)

Suggest syntax for toRecord