Supported Record Transformations in SuiteScript

Supported record transformations enable automated processes like order management by converting one record type to another.

·3 min read·1 views·View Oracle Docs

TL;DR Opening

Supported record transformations allow developers to automate various NetSuite processes by converting records from one type to another. This functionality is invaluable for scenarios like order processing or generating invoices from existing orders.

What Are Supported Transformations?

Using the record.transform method, you can effectively change a record's type while utilizing the existing data from another record. This feature aids in streamlining operations and automating repetitive tasks. For specific transformation types, refer to the section below.

Key Features

  • Method Description: Transforms records from one type to another.
  • Returns: A transformed record object.
  • Script Types Supported: Works with both client and server scripts.
  • Governance Limits:
    • Transaction records: 10 units
    • Custom records: 2 units
    • All other record types: 5 units

Parameters for Transformation

The options parameter is critical in defining the transformation specifics. Here are the parameters you need:

ParameterTypeRequiredDescription
fromTypestringRequiredThe current record type being transformed.
fromIdnumberRequiredThe internal ID of the record to transform.
toTypestringRequiredThe record type of the output after transformation.
isDynamicbooleanOptionalSets the transformation to dynamic mode if true (default is false).
defaultValuesObjectOptionalName-value pairs for default field values in the new record.

Errors

You may encounter the following error if any required arguments are not supplied:

  • Error Code: SSS_MISSING_REQD_ARGUMENT - Thrown if a required argument is missing or undefined.

Code Sample

This example demonstrates the basic syntax for transforming a record in SuiteScript:

suitescript
1var objRecord = record.transform({
2 fromType: record.Type.CUSTOMER,
3 fromId: 107,
4 toType: record.Type.SALES_ORDER,
5 isDynamic: true,
6});
suitescript
1record.transform({
2 fromType: 'salesorder',
3 fromId: 6,
4 toType: 'invoice',
5 defaultValues: { billdate: '01/01/2019' }
6});

Supported Transformation Types

Here is a comprehensive list of the supported transformations:

Original Record NameOriginal Record TypeTransformed Record NameTransformed Record Type
Assembly BuildassemblybuildAssembly Unbuildassemblyunbuild
Build/AssemblyassemblyitemAssembly Buildassemblybuild
Work OrderworkorderCash Refundcashrefund
Cash SalecashsaleCredit Memocreditmemo
CustomercustomerCustomer Paymentcustomerpayment
InvoiceinvoiceSales Ordersalesorder
JobjobEstimateestimate
Purchase OrderpurchaseorderVendor Billvendorbill
Custom Sales TransactioncustomsalestransactionCash Salecashsale

Note: Certain transformations like creating an Assembly Build for Outsourcing Work Orders are not supported. For detailed guidance on other specific transformations, ensure to check the relevant documentation or consult the NetSuite Help Center.

Key Takeaways

  • The record transformation feature automates data flow between different record types in NetSuite.
  • Understanding the parameters and governance limits can enhance script performance.
  • Utilize the provided code samples as a foundation for your custom transformations.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

Are there specific scripts that support the record transformation method in SuiteScript?
Yes, the record transformation method supports both client and server scripts in SuiteScript.
What are the governance limits for using the record.transform method with different record types?
The governance limits for the record.transform method are 10 units for transaction records, 2 units for custom records, and 5 units for all other record types.
What parameters are required to use the record.transform method in SuiteScript?
The required parameters for the record.transform method are 'fromType' (the current record type), 'fromId' (the internal ID of the record to transform), and 'toType' (the record type of the output).
What error might occur if required arguments are missing when transforming a record?
If any required arguments are missing, you may encounter the error code 'SSS_MISSING_REQD_ARGUMENT', indicating that a required argument is missing or undefined.
Source: Supported Transformation Types Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Integration

View all Integration articles →