In our previous article, New to NetSuite | Understanding SuiteScript 2.x Modules, we explored the SuiteScript Modules and N/record module, New to NetSuite | N/record Module Overview, which is used to interact with records. Now, we will take a closer look at one of the members of N/record: the record.Type object.
record.Type is an enumeration-like object that contains predefined string values for standard NetSuite record types (e.g., Sales Orders, Invoices, Customers, etc.). It allows you to easily refer to these types when creating, loading, deleting, or working with records in your SuiteScript code. Note: JavaScript doesn’t have built-in enumerations. In SuiteScript, the term "enum" simply refers to an object where each key maps to a specific string.