Modules

filter

 

Objects/Functions

module (N/record)

SuiteScript 2.0

record.submitFields.promise(options)

{record}.submitFields.promise({type: {string*},id: {number | string*},values: {Object*},options: {enablesourcing: {boolean},}).then(function(response){// DO SOMETHING WITH RESPONSE HERE}, function(error){// DO SOMETHING WITH ERROR HERE});

N/record Module
record.submitFields.promise()
Method Description: Updates and submits one or more body fields asynchronously on an existing record in NetSuite, and returns the internal ID of the parent record. When you use this method, you do not need to load or submit the parent record. You can use this method to edit and submit the following: Standard body fields that support inline editing (direct list editing). For more information, see Using Inline Editing. Custom body fields that support inline editing. You cannot use this method to edit and submit the following: Select fields Sublist line item fields Subrecord fields (for example, address fields) The parameters and errors thrown for this method are the same as those for record.submitFields(options). For more information on promises, see Promise Object.
Returns: Promise Object
Supported Script Types: Client-side scripts For more information, see SuiteScript 2.0 Client Script Type.
Governance: Transaction records: 10 units Custom records: 2 units All other records: 5 units
Module: N/record Module
Since: 2015.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=record.submitFields.promise(options)

Example:

// Code Example 1
// Add additional code
//...
function submitFields() {

var submitFieldsPromise = record.submitFields.promise({
type: record.Type.PHONE_CALL,
id: 171,
values: {
title: 'Sprint 3 planning'
},
});

submitFieldsPromise.then(function(recordId) {

// Add any needed logic that shouldn't execute until
// after the new value is submitted.

log.debug({
title: 'Record updated',
details: 'Id of updated record: ' + recordId
});

}, function(e) {
log.error({
title: e.name,
details: e.message
});
});
}
//...
// Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4440830813.html