N/record Module Members for SuiteScript Development
The N/record module simplifies SuiteScript development, allowing developers to create, delete, and modify NetSuite records efficiently.
The N/record module serves as a fundamental tool for SuiteScript developers to interact with NetSuite records. It offers functionalities to create, delete, copy, load, and update records. This module supports both standard NetSuite records and custom record types, making it essential for developers looking to leverage NetSuite's capabilities.
Key Features of the N/record Module
Module Capabilities
- Create Records: The
record.create(options)method creates a new record. - Delete Records: The
record.delete(options)method allows for deleting records. - Load Records: Use
record.load(options)to retrieve existing records for modification. - Transform Records: The
record.transform(options)method can convert a record from one type to another.
Supported Script Types
The N/record module is designed to be utilized in both client and server scripts, ensuring flexibility based on the development needs. This dual support allows developers to choose where their logic executes based on performance considerations and user interface requirements.
Important Considerations
- UI Interaction: SuiteScript executes its interactions without direct access to the NetSuite UI via the DOM. Instead, UI actions should be handled through the provided SuiteScript APIs to ensure stability and security.
- Record Types: The enum
record.Typesimplifies handling various record types—these can be referenced as needed when defining properties or conditions in your scripts.
Object Members Overview
The N/record module includes various object and method members, each serving distinct purposes:
| Member Type | Name | Return Type / Value Type | Supported Script Types | Description |
|---|---|---|---|---|
| Object | [record.Column](section_4600354269.html) | Object | Client and server scripts | Encapsulates a column of a sublist on a standard or custom record. |
| Object | [record.Field](section_4435738444.html) | Object | Client and server scripts | Represents fields in records. |
| Object | [record.Record](section_4205869719.html) | Object | Client and server scripts | Represents a record. |
| Method | [record.create(options)](section_4267258059.html) | record.Record | Client and server scripts | Creates a new record. |
| Method | [record.delete(options)](section_4267283372.html) | number | Client and server scripts | Deletes a record. |
These members encapsulate various functionalities essential for effective record manipulation within NetSuite.
Default Values in Record Creation
When creating records, specific default values can be designated using the defaultValues parameter. Certain records may have unique initialization types, which can streamline data entry on standard or custom forms. The following are examples of possible default values:
customform: Reference to a specific custom form ID.entity: This parameter can be utilized for records like Customer or Vendor.
Using these defaults strategically enhances user experience by providing pre-configured values, reducing manual input and potential errors.
Conclusion
The N/record module is invaluable for developers looking to leverage NetSuite's data structures efficiently. By understanding the object members and their functionalities, one can significantly enhance custom scripts and improve the overall integration with NetSuite.
Source: This article is based on Oracle's official NetSuite documentation.
Key Takeaways
- The N/record module is crucial for creating, modifying, and managing records.
- Supports both standard and custom NetSuite records.
- Key functions include
create,load,delete, andtransform. - Interactions with the UI should strictly use SuiteScript APIs.
- Default values streamline record creation processes.
Frequently Asked Questions (4)
Can the N/record module be used in both client and server scripts?
How can I specify default values when creating a record using the N/record module?
Are there any considerations when using SuiteScript for UI interactions with the N/record module?
Does the N/record module support transforming one record type to another?
Was this article helpful?
More in Platform
- Style Object Members for Workbook API in NetSuite
The Style object provides customizable properties for workbook formatting in NetSuite, enhancing report and visualization functionality.
- Asynchronous HTTP Requests with SuiteScript Promises
Use SuiteScript to send asynchronous HTTP requests with promises for efficient error handling and response processing.
- Setting Sublist Field Values in SuiteScript
Set values for sublist fields in SuiteScript using the setSublistValue method. Understand required parameters and error handling.
- In This Help Topic
Explore N/log module guidelines, log levels, and script execution logs for efficient logging in SuiteScript.
Advertising
Reach Platform Professionals
Put your product in front of NetSuite experts who work with Platform every day.
Sponsor This Category