In NetSuite SuiteScript, the N/record module is a core module used for working with records in the NetSuite system. NetSuite organizes data into records, which represent entities such as customers, transactions, items, or custom records. The N/record module provides methods for creating, reading, updating, and deleting records, as well as for searching and manipulating record data.
Here are some key functionalities provided by the N/record module:
- Record Creation: Users can use the
create() method to create new records of a specific type, such as creating a new customer, sales order, or custom record instance. - Record Loading and Modification: The
load() method allows users to load an existing record from the database based on its internal ID or other criteria, enabling them to retrieve and work with existing record data. Users can use various methods such as setValue(), getText(), getValue(), etc., to set or get the values of fields on a record, either by their internal IDs or field names. Meanwhile, the save() method is used to submit changes to the record and save them in the system. - Record Deletion: The
delete() method enables users to delete records from the system. - Record Search: While the
N/search module is primarily used for searching records, the N/record module also offers limited search capabilities through methods like getSublistValue(). - Others: Other things such as attaching or detaching a record to another record can be done with
attach()and detach(), or creating a record from another such as Sales Order to Item Fulfillment using transform().
To learn more about N/record module, please visit SuiteAnswers Articles: N/record Module and N/record Module Script Samples
Got any feedback? Let us know in the comments!