ServerResponse.sendRedirect(options)
Method Description |
Sets the redirect URL by resolving 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 |
|
Parent Object |
|
Sibling Object Members |
|
Since |
2015.2 |
Parameters
The options
parameter is a JavaScript object.
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 |
|
required |
The type of resource redirected to. |
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 |
|
number | 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 |
---|---|---|
|
Type argument {type} is not a valid record or is not available in your account. Please see the documentation for a list of supported record types. |
The redirect type is set to record, and an invalid record type is input for |
|
You have provided an invalid script id or internal id: {id} |
The type is set to Suitelet or RESTlet, and an invalid script ID or invalid deployment ID is input for |
|
The task ID: {id} is not valid. Please refer to the documentation for a list of supported task IDs. |
The type is set to task link, and an invalid task ID is input for |
|
The options.type: {type} is not valid. Please use http.RedirectType 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/http Module Script Samples.
// Add additional code
...
myServerResponseObj.sendRedirect({
type: http.RedirectType.RECORD,
identifier: record.Type.SALES_ORDER,
parameters: {entity: 8}
});
...
// Add additional code