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
- 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.
- Set Sublist Field Values in SuiteScript 2.x for Record Management
Set sublist field values in SuiteScript 2.x for effective record management using standard and dynamic modes.
- Setting Field Values in SuiteScript for Effective Record
Learn to set field values in SuiteScript effectively, troubleshooting common errors and understanding data types.
- 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.
Advertising
Reach SuiteScript Professionals
Put your product in front of NetSuite experts who work with SuiteScript every day.
Sponsor This Category