ServerResponse.sendRedirect(options)
Method Description |
Creates a redirect URL that resolves to a NetSuite resource. For example, you could use this method to redirect to a new sales order page for a particular entity. |
Returns |
void |
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2015.2 |
Parameters
The options
parameter is a JavaScript object.
All parameters must be prefixed with custparam
.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
number | string |
required |
The primary ID for this resource. The value you use varies depending on the value of
|
2015.2 |
|
string |
required |
The type of resource to which the script redirects. Use https.RedirectType to set a value for this parameter. |
2015.2 |
|
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 The default value is |
2015.2 |
|
string |
optional |
The secondary ID for this resource. If the |
2015.2 |
|
object |
optional |
Additional URL parameters as name:value pairs. |
2015.2 |
Errors
Error Code |
Message |
Thrown If |
---|---|---|
|
You have provided an invalid script id or internal id: {id} |
The |
|
The record type {type} is invalid. |
The |
|
The task ID: {id} is not valid. Please refer to the documentation for a list of supported task IDs. |
The |
|
The options.type: {type} is not valid. Please use https.RedirectType enum for supported types. |
The script uses an unrecognizable string value for the |
|
Missing a required argument: {param name} |
The |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/https Module Script Samples.
// Add additional code
...
myServerResponseObj.sendRedirect({
type: https.RedirectType.RECORD,
identifier: record.Type.SALES_ORDER,
parameters: {entity: 8}
});
...
// Add additional code