ServerResponse object method · N/https
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
A
suitescript api
1objServerResponse.sendRedirect({2 identifier: /* number | string, required */,3 type: /* string, required */,4 editMode: /* boolean, optional */,5 id: /* string, optional */6});
| Parameter | Type | Required | Description |
|---|---|---|---|
| options.identifier | number | string | required | The 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.type | string | required | The type of resource to which the script redirects. Use https.RedirectType to set a value for this parameter. |
| options.editMode | boolean | optional | Applicable 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.id | string | optional | The 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
mynt syntax
No Mynt syntax yet.
Nothing in the language compiles to ServerResponse.sendRedirect(options) today. How should it read?
C
community proposals
Competing syntax for sendRedirect, from GitHub Discussions. Select two or more to compare them side by side.
Loading 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?