SuiteScript 2.1 Scripting Records and Subrecords
You can use SuiteScript 2.1 to work with records and the subrecords that hold details for them.
Records
Records store NetSuite data in fields and sublists. Use record modules to work with records in server and client scripts. For guidance on choosing between N/record and N/currentRecord, see SuiteScript 2.1 Record Modules.
When you create, copy, load, or transform a record, you can work in standard or dynamic mode. For information about how these modes affect record behavior, see SuiteScript 2.1 Standard and Dynamic Record Modes.
Subrecords
A subrecord stores details for a particular parent record and can't exist independently. You access it through a summary field in the record body or on a sublist line.
Each subrecord type has its own purpose and set of fields. For example:
-
An address subrecord holds an address with fields like city, state, and zip.
-
An order schedule subrecord is for purchase schedules, with fields like startdate and enddate.
-
An inventory detail subrecord stores data like serial numbers for inventory items, with a sublist to hold this data.
Setting values on a subrecord can be more involved than setting other field values, but many record-scripting concepts still apply.
For guidelines and examples of creating, updating, and retrieving subrecords, see SuiteScript 2.1 Scripting with Subrecords.