Modules

filter

 

Objects/Functions

module (N/redirect)

SuiteScript 2.0

redirect.toRecordTransform(options)

{redirect}.toRecordTransform({fromId: {number*},fromType: {string*},toType: {string*},parameters: {Object}})

N/redirect Module
redirect.toRecordTransform()
Method Description: Transforms a record to a standard or custom transaction instance. The fromId and fromType parameters can be acquired from the context object provided by the onAction(scriptContext) method of a workflow action script. The toType record type identifier cannot be acquired programmatically and must be entered manually. 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 options.parameters parameter. For record field values, use the record.fieldId format. Invalid keys are ignored. The user can edit transaction details before saving. For a list of supported transformation types, see Supported Transformation Types.
Returns: void
Supported Script Types: Server scripts For more information, see SuiteScript 2.0 Script Types.
Governance: None
Module: N/redirect Module
Sibling Module Members: N/redirect Module Members
Since: 2020.1
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=redirect.toRecordTransform(options)

Example:

// Code Example 1
// 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

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_157713182405.html