redirect.toRecord(options)
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 User Event scripts -beforeLoad entry point 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 |
|
Since |
2015.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
string |
required |
The internal id of the target record. |
|
string |
required |
The type of record. |
|
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 |
|
Object |
optional |
Contains additional URL parameters as key-value pairs. |
Syntax
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