Records

SuiteScript Record Types

Working with Record Types

SuiteScript record types include salesorder and customer for CRUD.

Understanding SuiteScript Record Types

In SuiteScript, record types are essential components that represent NetSuite records. These record types allow developers to perform CRUD (Create, Read, Update, Delete) operations programmatically on NetSuite data. Common record types include salesorder and customer, among many others.

CRUD Operations with SuiteScript

CRUD operations are fundamental to interacting with NetSuite records. SuiteScript provides a set of APIs to perform these operations on various record types.

Creating a New Record

To create a new record in SuiteScript, you use the record.create() method. Below is an example of creating a new customer record.

Reading a Record

To read an existing record, you use the record.load() method. Here's how you can load a salesorder record:

Updating a Record

Updating a record involves loading the record, modifying its values, and then saving it. Below is an example of updating a customer record's email address:

Deleting a Record

To delete a record, the record.delete() method is used. The following example demonstrates how to delete a salesorder record:

Conclusion

Understanding how to work with SuiteScript record types is crucial for manipulating NetSuite records efficiently. By mastering CRUD operations, developers can automate and optimize workflows within NetSuite.