record.Record

Object Description

Encapsulates a NetSuite record.

There are two modes you can operate in when you create, copy, load, or transform a record with SuiteScript 2.0: standard mode and dynamic mode.

  • When a SuiteScript 2.0 script creates, copies, loads, or transforms a record in standard mode, the record’s body fields and sublist line items are not sourced, calculated, and validated until the record is saved (submitted) with Record.save(options).

    When you work with a record in standard mode, you do not need to set values in any particular order. After submitting the record, NetSuite processes the record’s body fields and sublist line items in the correct order, regardless of the organization of your script.

  • When a SuiteScript 2.0 script creates, copies, loads, or transforms a record in dynamic mode, the record’s body fields and sublist line items are sourced, calculated, and validated in real-time. A record in dynamic mode emulates the behavior of a record in the UI.

    When you work with a record in dynamic mode, it is important that you set values in the same order you would within the UI. If you fail to do this, your results may not be accurate.

The record.create(options), record.copy(options), record.load(options), and record.transform(options) methods work in standard mode by default. If you want these methods to work in dynamic mode, you must pass in a specific argument. See the help topic for the applicable method for more information.

Use record.Type enum for multiple records. For help finding a record’s internal ID, see Finding Internal IDs of Records.

For more information about standard and dynamic modes, see SuiteScript 2.x Standard and Dynamic Modes

For a complete list of this object’s methods and properties, see Record Object Members.

Supported Script Types

Client and server scripts

For more information, see SuiteScript 2.x Script Types.

Module

N/record Module

Since

2015.2

Syntax
Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/record Module Script Samples.

          // Add additional code
...
var objRecord = record.load({
    type: record.Type.SALES_ORDER, 
    id: '6',
    isDynamic: true
});
...
// Add additional code 

        

Related Topics

General Notices