record.submitFields.promise(options)
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:
You cannot use this method to edit and submit the following:
Note:
The parameters and errors thrown for this method are the same as those for record.submitFields(options). For more information oabout promises, see Promise Object. |
Returns |
|
Synchronous Version |
|
Supported Script Types |
Client scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
Transaction records: 10 units Custom records: 2 units All other records: 5 units |
Module |
|
Since |
2015.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required |
The record type. Use the following guidelines:
|
2015.2 |
|
number | string |
required |
The internal ID of the existing record instance in NetSuite. |
2015.2 |
|
Object |
required |
The ID-value pairs for each field you want to edit and submit. |
2015.2 |
|
Object |
optional |
Additional options to set for the record. |
2015.2 |
|
boolean |
optional |
Indicates whether to enable sourcing during the record update. By default, this value is |
2015.2 |
|
boolean |
optional |
Indicates whether to ignore required fields during record submission. By default, this value is |
2015.2 |
Errors
Error Code |
Thrown If |
---|---|
|
A required argument is missing or undefined. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete promise script example, see Promise Object.
// 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