N/record Default Values for SuiteScript Record Management
N/record module allows setting default values for creating, copying, and loading records in SuiteScript.
The N/record module is crucial for managing NetSuite records, enabling operations such as creation, deletion, copying, and loading of records. This article details how to specify default values when initializing records, which can streamline record handling in your SuiteScript implementations.
How to Use Default Values in N/record
Default values can be specified by using the optional defaultValues parameter in the following APIs:
record.create(options)record.copy(options)record.transform(options)record.load(options)
Supported Initialization Types
The following table lists the initialization types available for SuiteScript-supported records and the corresponding values you can set:
| Record | Initialization Type | Values |
|---|---|---|
| All SuiteScript-supported records | customform | _customformid_ |
| Assembly Build | assemblyitem | _assemblyitemid_ |
| Cash Refund | entity | _entityid_ |
| Cash Sale | entity | _entityid_ |
| Charge Rule | entity | _entityid_ |
| Check | entity | _entityid_ |
| Credit Memo | entity | _entityid_ |
| Customer Payment | entity | _entityid_ |
| Customer Refund | entity | _entityid_ |
| Deposit | disablepaymentfilters | _disablepaymentfilters_ |
| Estimate | entity | _entityid_ |
| Expense Report | entity | _entityid_ |
| Invoice | entity | _entityid_ |
| Item Receipt | entity | _entityid_ |
| Non-Inventory Part | subtype | sale, resale, purchase |
| Opportunity | entity | _entityid_ |
| Purchase Order | entity | _entityid_ |
| Sales Order | entity | _entityid_ |
| Tax Group | nexuscountry | _countrycode_ |
| Tax Type | country | _countrycode_ |
| Vendor Bill | entity | _entityid_ |
| Vendor Payment | entity | _entityid_ |
| Work Order | assemblyitem | _assemblyitemid_ |
Country Codes for Tax Records
When scripting Tax Group or Tax Type records, you can utilize specific country codes. For example:
record.create('taxgroup', {nexuscountry: 'AR'});The country codes are essential for correct initialization. Here’s a brief list of some country codes for reference:
| Country Code | Country Name |
|---|---|
| AD | Andorra |
| AE | United Arab Emirates |
| AR | Argentina |
| CA | Canada |
| DE | Germany |
By utilizing default values and understanding how to initialize records effectively, developers can substantially enhance productivity in their SuiteScript applications.
Key Takeaways
- The N/record module allows customization of default values when managing records.
- Initialization types such as
customer,entity, andcustomformcan streamline record creation processes. - Utilizing country codes can ensure compliance with specific regional requirements in tax-related records.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
How can I set default values when creating a record using SuiteScript?
Which records support the use of the `entity` initialization type?
Can I specify country codes for tax records in SuiteScript?
What parameter should be used to disable payment filters when loading a Deposit record?
Was this article helpful?
More in General
- Payment Date Prediction Feature in NetSuite
Payment Date Prediction in NetSuite utilizes machine learning to enhance financial planning by predicting invoice payment dates.
- NetSuite Ship Central Enhancements for Packing & Shipping
NetSuite Ship Central features enhance packing and shipping operations for improved efficiency and accuracy.
- New Role Setup for NetSuite AI Connector Service in 2026.1
The 2026.1 release adds a new role requirement for the NetSuite AI Connector Service, streamlining custom tool development.
- Generative AI Features in NetSuite 2026.1
Discover new generative AI features in NetSuite 2026.1, enhancing reporting, search, predictions, and development productivity.
Advertising
Reach General Professionals
Put your product in front of NetSuite experts who work with General every day.
Sponsor This Category