N/record Module Members for SuiteScript Development

The N/record module simplifies SuiteScript development, allowing developers to create, delete, and modify NetSuite records efficiently.

·3 min read·View Oracle Docs

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.Type simplifies 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 TypeNameReturn Type / Value TypeSupported Script TypesDescription
Object[record.Column](section_4600354269.html)ObjectClient and server scriptsEncapsulates a column of a sublist on a standard or custom record.
Object[record.Field](section_4435738444.html)ObjectClient and server scriptsRepresents fields in records.
Object[record.Record](section_4205869719.html)ObjectClient and server scriptsRepresents a record.
Method[record.create(options)](section_4267258059.html)record.RecordClient and server scriptsCreates a new record.
Method[record.delete(options)](section_4267283372.html)numberClient and server scriptsDeletes 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, and transform.
  • 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?
Yes, the N/record module is designed to work with both client and server scripts, offering flexibility based on the developer's needs for logic execution and performance considerations.
How can I specify default values when creating a record using the N/record module?
Default values can be specified during record creation using the `defaultValues` parameter, which allows for pre-configured values like `customform` and `entity`, enhancing user efficiency.
Are there any considerations when using SuiteScript for UI interactions with the N/record module?
Yes, SuiteScript should use provided APIs for UI interactions instead of direct DOM access to ensure stability and security.
Does the N/record module support transforming one record type to another?
Yes, the `record.transform(options)` method allows for converting a record from one type to another within the module.
Source: N/record Module Members Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Platform

View all Platform articles →