Record Object Members in SuiteScript for Effective Data Handling
Learn key Record object members in SuiteScript: name, primary key, properties for efficient data management.
The Record object in SuiteScript provides essential properties for managing data efficiently within NetSuite. It includes crucial members such as the record name, primary key, and its properties, supporting server-side scripts for powerful data manipulation. This article describes these members in detail and explains their significance in SuiteScript development.
What Are Record Object Members?
The Record object members available for a workbook.Record object include:
| Member Name | Type | Description | Supported Script Types |
|---|---|---|---|
Record.name | string | The name of the record type for the record. | Server scripts |
Record.primaryKey | number | The primary key of the record. | Server scripts |
Record.properties | Object | The properties of the record. | Server scripts |
Detailed Member Descriptions
-
Record.name: This property returns the string value representing the record type's name. It is essential to identify the specific type of record you are working with in your scripts. -
Record.primaryKey: This numeric property holds the primary key for the record, allowing for unique identification and referencing within operations. -
Record.properties: This object contains the properties associated with the record, enabling developers to access and manipulate relevant data easily.
Usage Notes
When using these properties, keep in mind:
- The
Record.nameproperty is read-only. Attempting to set its value after theworkbook.Recordobject creation will lead to aREAD_ONLY_PROPERTYerror.
For more information on SuiteScript and workbook modules, check the SuiteScript 2.x Script Types documentation.
Frequently Asked Questions (4)
Are the Record object members in SuiteScript available for all types of scripts?
Can I modify the value of the Record.name property in a SuiteScript?
What is the significance of the Record.primaryKey in SuiteScript?
What should developers be aware of when accessing Record.properties in SuiteScript?
Was this article helpful?
More in SuiteScript
- Common SuiteScript Errors and Solutions for NetSuite
Common NetSuite script errors include INVALID_SCRIPT_DEPLOYMENT_ID and SSS_AUTHORIZATION_HEADER_NOT_ALLOWED. Learn effective solutions.
- SuiteScript 2.x Sublist Values: Standard and Dynamic Mode
Use setSublistValue in standard mode; select a line, set its current value and commit it in dynamic mode. Choose the API from the record's mode.
- SuiteScript 2.1 Enhancements and API Updates in NetSuite
SuiteScript 2.1 enables execution of 2.0 scripts and supports PATCH method for enhanced API capabilities.
- SuiteScript Record.setValue: Body Fields, Types and Errors
Set NetSuite body fields with Record.setValue, matching field IDs and value types and checking common API errors.
