record.submitFields.promise(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

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)

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

Promise Object

Synchronous Version

record.submitFields(options)

Supported Script Types

Client scripts

For more information, see SuiteScript 2.x Client Script Type.

Governance

Transaction records: 10 units

Custom records: 2 units

All other records: 5 units

Module

N/record Module

Since

2015.2

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

Since

options.type

string

required

The record type.

Use the following guidelines:

  • When working with an instance of a standard NetSuite record type, set this value by using the record.Type enum.

  • When working with an instance of a custom record type, set this value by using the custom record type’s string ID. For help finding this ID, see Custom Record.

2015.2

options.id

number | string

required

The internal ID of the existing record instance in NetSuite.

2015.2

options.values

Object

required

The ID-value pairs for each field you want to edit and submit.

2015.2

options.options

Object

optional

Additional options to set for the record.

2015.2

options.options.enablesourcing

boolean

optional

Indicates whether to enable sourcing during the record update.

By default, this value is true.

2015.2

options.options.ignoreMandatoryFields

boolean

optional

Indicates whether to ignore required fields during record submission.

By default, this value is false.

2015.2

Errors

Error Code

Thrown If

SSS_MISSING_REQD_ARGUMENT

A required argument is missing or undefined.

Syntax
Important:

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 

        

Related Topics

N/record Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices