ServerResponse object method · N/http

sendRedirect()

ServerResponse.sendRedirect(options)

Sets the redirect URL by resolving to a NetSuite resource.

Implementation
Not started
Design
Open for proposals suggest how it should read
Proposals
A
Signature
ServerResponse.sendRedirect(options)
Module
N/http
Returns
void
Governance
None
Script types
Server scripts
Version
SuiteScript 2.x, documented for 2.1; since NetSuite 2015.2
call shapefrom Oracle's parameter table
1objServerResponse.sendRedirect({2    identifier: /* number | string, required */,3    type:       /* http.RedirectType, required */,4    editMode:   /* boolean, optional */,5    id:         /* number | string, optional */6});
Oracle reference for this method
ParameterTypeRequiredDescription
options.identifiernumber | stringrequiredThe primary ID for this resource. The value you use varies depending on the value of options.type , as follows: MEDIA_ITEM - Use the internal ID of a file stored in the NetSuite File Cabinet. RECORD - Use record.Type to identify the appropriate record type. RESTLET - Use the script ID from the script record of the appropriate RESTlet. SUITELET - Use the script ID from the script record of the appropriate Suitelet. TASK_LINK - Use the appropriate Task ID. Supported IDs are listed in Task IDs .
options.typehttp.RedirectTyperequiredThe type of resource redirected to.
options.editModebooleanoptionalApplicable when redirecting to a record resource. Specifies whether to return a URL for a record in edit mode or view mode. If set to true , returns the record in edit mode. If set to false , returns the record in view mode. The default value is false .
options.idnumber | stringoptionalThe secondary ID for this resource. If the options.type parameter is set to SUITELET or RESTLET, use the deployment ID. If the options.type parameter is set to RECORD, you can use the internal ID of a specific record instance.
B

No Mynt syntax yet.

Nothing in the language compiles to ServerResponse.sendRedirect(options) today. How should it read?

C

Competing syntax for sendRedirect, from GitHub Discussions. Select two or more to compare them side by side.

All discussions

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/http · ServerResponse.sendRedirect(options)

Suggest syntax for sendRedirect