redirect.toSuitelet(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Redirects the user to a Suitelet.

For more information about Suitelets, see SuiteScript 2.x Suitelet Script Type.

Note:

The redirect happens after the script finishes.

Returns

void

Supported Script Types

Suitelets, beforeLoad user events, and synchronous afterSubmit user events. This module does not support beforeSubmit or asynchronous afterSubmit user events. This module is only supported when triggered from the UI. Backend contexts such as CSV Import and Scheduled Scripts are not supported.

For more information, see SuiteScript 2.x Script Types.

Governance

None

Module

N/redirect Module

Since

2015.2

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

options.scriptId

string

required

The script ID for the Suitelet.

options.deploymentId

string

required

The deployment ID for the Suitelet.

options.isExternal

boolean

optional

The default value is false – indicates an external Suitelet URL.

options.parameters

Object

optional

Contains additional URL parameters as key-value pairs.

Note:

Parameters cannot be arrays. Use JSON.stringify/JSON.parse instead to handle arrays.

Syntax
Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/redirect Module Script Sample.

          //Add additional code 
...
redirect.toSuitelet({
    scriptId: '31',
    deploymentId: '1',
    parameters: {
        'custparam_test':'helloWorld'
    } 
});
...
//Add additional code 

        

Related Topics

N/redirect Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices