Record Object Members
Explore the N/record module in SuiteScript for managing records, including methods for creating, updating, and deleting records.
The N/record module is essential for developers working with NetSuite records, offering a range of functionality to create, delete, copy, load, or modify records. This module supports both standard NetSuite records and custom record types, making it versatile for various scripting needs.
What is the N/record Module?
The N/record module is used to interact with NetSuite records programmatically. It allows developers to manage records efficiently through SuiteScript, which is the JavaScript-based scripting language for NetSuite.
Key Features of the N/record Module
- Standard and Custom Records: The module supports standard NetSuite records along with instances of custom record types. This flexibility allows for tailored solutions depending on business requirements.
- Access Methods: The N/record module provides methods for record operations like creating, loading, copying, deleting, and more, making it a foundational tool for developers.
N/record Module Members
The N/record module consists of various members categorized into objects, methods, and enums:
Object Members
| Name | Type | Description |
|---|---|---|
record.Column | Object | Represents a column of a sublist on a standard or custom record. |
record.Field | Object | Represents a field in the body or sublist on a standard or custom record. |
record.Record | Object | Represents a NetSuite record. |
record.Sublist | Object | Represents a sublist on a standard or custom record. |
Method Members
| Name | Return Type | Description |
|---|---|---|
record.create(options) | record.Record | Creates a new record. |
record.delete(options) | number | Deletes a record. |
record.load(options) | Object | Loads an existing record. |
record.submitFields(options) | Object | Updates and submits body fields on an existing record. |
record.transform(options) | record.Record | Transforms a record from one type to another. |
Enum Members
| Name | Type | Description |
|---|---|---|
record.Type | enum | Holds string values for supported record types. |
Best Practices
- Always use the appropriate object and method types for the specific records you are working with to ensure smooth integrations and operations.
- Avoid direct access to the NetSuite UI through the Document Object Model (DOM). Instead, utilize SuiteScript APIs to interact with records and UI elements.
Conclusion
Understanding the N/record module and its members is crucial for effective SuiteScript development in NetSuite. By familiarizing yourself with its capabilities and best practices, you can leverage the full potential of record handling in your NetSuite applications.
Key Takeaways
- The N/record module allows for sophisticated record management in SuiteScript.
- Both standard and custom records are supported, enhancing flexibility.
- Various object and method members are provided to streamline operations.
- Avoid DOM manipulation; use SuiteScript APIs for UI access.
Frequently Asked Questions (4)
Can the N/record module handle both standard and custom records?
What is the purpose of the `record.transform(options)` method in the N/record module?
Are there any best practices for using the N/record module?
What object members are included in the N/record module?
Was this article helpful?
More in SuiteScript
- SuiteScript 2.1 Enhancements in NetSuite February Updates
SuiteScript 2.1 now supports async features and PATCH method. Discover the latest API and SuiteProcurement improvements.
- Scheduling Map/Reduce Script Deployments in NetSuite
Learn to schedule map/reduce script submissions, including one-time and recurring options in NetSuite.
- Binary File Support in N/https Module for SuiteScript
SuiteScript enhances capabilities with binary file support in the N/https module, allowing improved data handling in external communications.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
