record.load(options)

Method Description

Loads an existing record.

Note that the maximum number of lines on record’s sublist is limited to 10,000, see Limits for Display of Transaction Lists and Sublists

Note:

For the promise version of this method, see record.load.promise(options). Note that promises are only supported in client scripts. Make sure you save the record before loading it.

Returns

record.Record

Supported Script Types

Client and server scripts

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

Governance

Transaction records: 10 units

Custom records: 2 units

All other records: 5 units

Module

N/record Module

Since

2015.2

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

Since

options.type

string

required

The record type.

Use the following guidelines:

  • When loading an instance of a standard NetSuite record type, set this value by using the record.Type enum.

  • When loading an instance of a custom record type, set this value by using the custom record type’s string ID. For help finding this ID, see Custom Record.

2015.2

options.id

number

required

The internal ID of the existing record instance in NetSuite. The internal ID of the record is displayed on the list page for the record type.

 

options.isDynamic

boolean

optional

Determines whether the record is loaded in dynamic mode.

  • If set to true, the record is loaded in dynamic mode.

  • If set to false, the record is loaded in standard mode.

By default, this value is false.

Note:

For additional information about standard and dynamic mode, see record.Record and SuiteScript 2.x Standard and Dynamic Modes.

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.

 

Errors

Error Code

Thrown If

SSS_MISSING_REQD_ARGUMENT

A required argument is missing or undefined.

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
...

// Load a sales order
var objRecord = record.load({
    type: record.Type.SALES_ORDER, 
    id: 157,
    isDynamic: true,
});

// Load an instance of a custom record type with the ID customrecord_feature.
var newFeatureRecord = record.load({
    type: 'customrecord_feature',
    id: 1,
    isDynamic: true                       
});
...   
// Add additional code 

        

Related Topics

General Notices