Records
SuiteScript Custom Records
Creating Custom Records
SuiteScript custom records extend NetSuite’s data model.
Understanding Custom Records
In NetSuite, custom records allow developers to extend the application's data model to fit specific business needs. Unlike standard records, custom records are user-defined and can be tailored to capture and store unique data types that are not supported by default. By leveraging SuiteScript, developers can programmatically interact with these custom records, enabling complex business logic and integrations.
Creating a Custom Record Type
To create a custom record type, navigate to Customization > Lists, Records, & Fields > Record Types > New. Here, you can define the record name, ID, and other configurations. Once created, these records can be accessed and manipulated using SuiteScript.
Working with Custom Records in SuiteScript
After defining a custom record type, you can use SuiteScript to create, read, update, and delete instances of these records. SuiteScript 2.0 provides several modules for handling custom records, such as record
and search
.
Searching Custom Records
To search for custom records, you can use the search
module in SuiteScript 2.0. This module allows for both basic and advanced searches, enabling you to retrieve records that meet specific criteria.
Updating Custom Records
To update an existing custom record, you can load the record using the record
module, modify its fields, and save the changes. This allows you to programmatically alter data based on business logic or external triggers.
Deleting Custom Records
To delete a custom record, use the record
module to remove the record by its ID. This operation is irreversible, so ensure that the record is no longer needed before deletion.
Records
- Record Types
- Custom Records
- Fields
- Sublists
- Transactions
- Previous
- Record Types
- Next
- Fields