Modules

filter

 

Objects/Functions

module (N/record)

SuiteScript 2.0

record.transform(options)

{record}.transform({fromType: {string*},fromId: {number*},toType: {string*},isDynamic: {boolean},defaultValues: {Object}})

N/record Module
record.transform()
Method Description: Transforms a record from one type into another, using data from an existing record. You can use this method to automate order processing, creating item fulfillment transactions and invoices off of orders. For a list of supported transformations, see Supported Transformation Types. For the promise version of this method, see record.transform.promise(options). Note that promises are only supported in client scripts.
Returns: record.Record
Supported Script Types: Client and server-side scripts For more information, see SuiteScript 2.0 Script Types.
Governance: Transaction records: 10 units Custom records: 2 units All other record types: 5 units
Module: N/record Module
Since: 2015.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=record.transform(options)

Example:

// Code Example 1
// Add additional code.
//...
var objRecord = record.transform({
fromType: record.Type.CUSTOMER,
fromId: 107,
toType: record.Type.SALES_ORDER,
isDynamic: true,
});
//...
// Add additional code.

// Code Example 2
// Add additional code.
//...
record.transform({
fromType:'salesorder',
fromId: 6,
toType: 'invoice',
defaultValues: {
billdate: '01/01/2019'} });
//...
// Add additional code.

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