redirect.toRecordTransform(options)
Method Description |
Transforms a record to a standard or custom transaction instance. The The new transaction instance opens in edit mode with all possible fields defaulted from the source record. To specify URL parameters or record field values on the redirected page, use the For a list of supported transformation types, see Supported Transformation Types. |
Returns |
void |
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Sibling Module Members |
|
Since |
2020.1 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
number |
required |
The ID of the source record. |
|
string |
required |
The ID of the source record type. |
|
string |
required |
The ID of the target record type. |
|
Object |
optional |
Contains additional parameters as key-value pairs. |
Errors
Error Code |
Error Message |
Thrown If |
---|---|---|
|
The record type ‘type’ is invalid. |
The record type specified in the |
|
That type of record transformation is not allowed. Please see the documentation for a list of supported transformation types. |
Transformation between 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/redirect Module Script Sample.
// Add additional code
...
define(['N/redirect'], function (redirect) {
return {
onAction: function (context)
{
redirect.toRecordTransform({
fromType: context.newRecord.type,
fromId: context.newRecord.id,
toType: 'invoice',
parameters: {
'record.memo': 'memo override', // override of memo field on body form
'cf':'92' // std product invoice custom form
}
});
},
}
});
...
// Add additional code