record.submitFields: Update Records Efficiently in NetSuite
The record.submitFields method allows easy updates to body fields on existing NetSuite records without loading the parent record.
The record.submitFields method in NetSuite allows developers to update and submit body fields on existing records efficiently. This method is beneficial as it eliminates the need to load the parent record, streamlining data management processes.
Method Overview
What Does record.submitFields Do?
The method updates specified fields for a record and returns the internal ID of the parent record. The key advantage is that both standard and custom body fields that support inline editing can be modified. However, certain limitations exist regarding the types of fields that can be updated.
Editable and Non-Editable Fields
You can edit:
- Standard body fields that support inline editing.
- Custom body fields that support inline editing.
- Select and multi-select fields.
You cannot edit:
- Sublist line item fields.
- Subrecord fields (like address fields).
Method Return Value
The method returns the internal ID of the parent record being updated, facilitating further operations if needed.
Script Compatibility
This method is compatible with both client and server scripts within the SuiteScript framework.
Governance
Usage of the method is governed based on the type of record being updated:
- Transaction records: 10 units per call
- Custom records: 2 units per call
- All other records: 5 units per call
Parameters
The options parameter is a JavaScript object that includes several properties necessary for executing record.submitFields successfully:
| Parameter | Type | Required/Optional | Description |
|---|---|---|---|
options.type | string | Required | Indicates the record type. Use record.Type enum for standard records; string ID for custom records. |
options.id | number | string | Required |
options.values | Object | Required | Key-value pairs for fields to be updated, ensuring values are of the correct type. |
options.options | Object | Optional | Additional options during the record update. Items include enableSourcing and ignoreMandatoryFields. |
Example Usage
Here are some examples demonstrating how to utilize this method:
Update a Sales Order's Memo Field
1var id = record.submitFields({2 type: record.Type.SALES_ORDER,3 id: 1,4 values: {5 memo: 'ABC'6 }7});Update Custom Record Field
1var otherId = record.submitFields({2 type: 'customrecord_book',3 id: '4',4 values: {5 'custrecord_rating': '2'6 }7});Update Fields with Select and Multi-Select Types
1var thirdID = record.submitFields({2 type: record.Type.SALES_ORDER,3 id: 21882,4 values: {5 'custbodycust_txt_fld_custso': 'Hello from custom field',6 'memo': 'Hello from memo',7 'leadsource': 254, // select field8 'custbody_target_market': '1' // custom multi-select field9 }10});Errors
Developers should be aware of error codes that may arise, specifically:
SSS_MISSING_REQD_ARGUMENT: This error is thrown when a required argument is missing or undefined during execution.
This method significantly enhances the efficiency of record management in NetSuite, giving developers more power over how they manipulate data.
Key Takeaways
- The
record.submitFieldsmethod allows efficient updates to NetSuite records. - Developers must specify record types and IDs to utilize this method correctly.
- Different record types have varying governance limits regarding method usage.
- This method does not allow updates to sublist or subrecord fields.
- Developers should handle potential errors related to required arguments carefully.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
Can the record.submitFields method in NetSuite be used to update sublist line item fields?
What are the governance limits for using record.submitFields on different types of records?
Is the enableSourcing option mandatory when using the record.submitFields method?
What happens if a required argument is missing when executing record.submitFields?
Was this article helpful?
More in Integration
- Natural Language Queries in NetSuite AI
MCP Standard Tools SuiteApp enables AI-driven data tasks in NetSuite, aligned with role permissions.
- Square Connector Integration in NetSuite 2026.1
Discover the Square Connector for seamless integration with NetSuite 2026.1, synchronizing transactions, orders, and inventory effortlessly.
- SuiteTalk Web Services Updates for NetSuite Integrations
SuiteTalk Web Services adds new Item Supply Plan support, enhancing integrations for efficient data management.
- SuiteTalk Web Services Enhancements in NetSuite
Explore the latest enhancements to SuiteTalk Web Services, improving integration and API functionalities in NetSuite.
Advertising
Reach Integration Professionals
Put your product in front of NetSuite experts who work with Integration every day.
Sponsor This Category