Record Object Members

Explore the N/record module in SuiteScript for managing records, including methods for creating, updating, and deleting records.

·3 min read·View Oracle Docs

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

NameTypeDescription
record.ColumnObjectRepresents a column of a sublist on a standard or custom record.
record.FieldObjectRepresents a field in the body or sublist on a standard or custom record.
record.RecordObjectRepresents a NetSuite record.
record.SublistObjectRepresents a sublist on a standard or custom record.

Method Members

NameReturn TypeDescription
record.create(options)record.RecordCreates a new record.
record.delete(options)numberDeletes a record.
record.load(options)ObjectLoads an existing record.
record.submitFields(options)ObjectUpdates and submits body fields on an existing record.
record.transform(options)record.RecordTransforms a record from one type to another.

Enum Members

NameTypeDescription
record.TypeenumHolds 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.


Source: This article is based on Oracle's official NetSuite documentation.

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?
Yes, the N/record module supports both standard NetSuite records and custom record types, allowing developers to tailor their solutions based on business needs.
What is the purpose of the `record.transform(options)` method in the N/record module?
The `record.transform(options)` method is used to transform a record from one type to another, facilitating processes that require changing the record's structure or type in SuiteScript.
Are there any best practices for using the N/record module?
Yes, it is recommended to use the appropriate object and method types for specific records and to avoid accessing the NetSuite UI through the DOM. Instead, SuiteScript APIs should be used for interacting with records and UI elements.
What object members are included in the N/record module?
The N/record module includes object members such as `record.Column`, `record.Field`, `record.Record`, and `record.Sublist`, each representing different components of a standard or custom record.
Source: Record Object 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 →