Record.save.promise(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Submits a new record asynchronously or saves edits to an existing record asynchronously.

This method is not available to subrecords.

Note:

The parameters and errors thrown for this method are the same as those for Record.save(options). For more information about promises, see Promise Object.

Returns

Promise Object

Synchronous Version

Record.save(options)

Supported Script Types

Client scripts

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

Governance

Transaction records: 20 units

Custom records: 4 units

All other records: 10 units

Module

N/record Module

Sibling Object Members

Record Object Members

Since

2015.2

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

Since

options.enableSourcing

boolean

optional

Enables sourcing during the record update.

If set to true, sources dependent field information for empty fields.

Defaults to false – dependent field values are not sourced.

Important:

This parameter applies to records in standard mode only. When working with records in dynamic mode, field values are always sourced and the value you provide for enableSourcing is ignored. See SuiteScript 2.x Standard and Dynamic Modes.

2015.2

options.ignoreMandatoryFields

boolean

optional

Disables required field validation for this save operation.

If set to true, all standard and custom fields that are required through customization are ignored. All fields that are required through company preferences are also ignored.

By default, this parameter is false.

Important:

Use the ignoreMandatoryFields argument with caution. This argument should be used mostly with Scheduled scripts, rather than User Event scripts. This ensures that UI users do not bypass the business logic enforced through form customization.

2015.2

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
...
var recordId = objRecord.save.promise({
    enableSourcing: true,
    ignoreMandatoryFields: true
});
...
// Add additional code 

        

Related Topics

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

General Notices