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.
| Returns | record.Record |
| Supported Script Types | Client and server scripts |
| Governance | Transaction records: 10 units Custom records: 2 units All other record types: 5 units |
| Module | N/record Module |
Parameters:
| Parameter | Type | Required / Optional | Description | Since |
|---|---|---|---|---|
options.fromType | string | required | The record type of the existing record instance being transformed.This value sets the Record.type property for the record. This property is read-only and cannot be changed after the record is loaded.Set this value using the record.Type. | 2015.2 |
options.fromId | number | required | The internal ID of the existing record instance being transformed. | 2015.2 |
options.toType | string | required | The record type of the record returned when the transformation is complete. | 2015.2 |
options.isDynamic | boolean | optional | Determines whether the new record is created in dynamic mode. | 2015.2 |
options.defaultValues | Object | optional | Name-value pairs containing default values of fields in the new record.By default, this value is null.For a list of available record default values, see N/record Default Values in the NetSuite Help Center. | 2015.2 |
Errors:
| Error Code | Thrown If |
|---|---|
SSS_MISSING_REQD_ARGUMENT | A required argument is missing or undefined. |
Syntax:
// Add additional code.
...
record.transform({
fromType:'salesorder',
fromId: 6,
toType: 'invoice',
defaultValues: {
billdate: '01/01/2019'}
});
...
// Add additional code.