redirect.toRecord(options)

Note:

The options parameter is a JavaScript object.

Method Description

Sets the redirect URL to a specific NetSuite record.

Note:

If you redirect a user to a record, the record must first exist in NetSuite. If you want to redirect a user to a new record, you must first create and submit the record before redirecting them. You must also ensure that any required fields for the new record are populated before submitting the record.

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.id

string

required

The internal id of the target record.

options.type

string

required

The type of record.

options.isEditMode

boolean

optional

Determines whether to return a URL for the record in edit mode or view mode. If set to true, returns the URL to an existing record in edit mode.

The default value is false – returns the URL to a record in view mode.

options.parameters

Object

optional

Contains additional URL parameters as key-value pairs.

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.toRecord({
    type: record.Type.TASK, 
    id: taskRecordId,
    parameters: {
        'custparam_test':'helloWorld'
    } 
});
...
//Add additional code 

        

Related Topics

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

General Notices