Record.save(options)
Method Description |
Submits a new record or saves edits to an existing record. When working with records in standard mode, you must submit and then load the record to obtain sourced, validated, and calculated field values. This method is not available to subrecords.
Note:
This method has an asynchronous counterpart you can use with client scripts. See Record.save.promise(options). |
Returns |
A number representing the internal ID of the new or updated record. |
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
Transaction records: 20 units Custom records: 4 units All other records: 10 units |
Module |
|
Sibling Object Members |
|
Since |
2015.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
boolean |
optional |
Enables sourcing during the record update. If set to Defaults to
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 |
2015.2 |
|
boolean |
optional |
Disables required field validation for this save operation. If set to By default, this parameter is
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
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/record Module Script Samples.
// Add additional code
...
var recordId = objRecord.save({
enableSourcing: true,
ignoreMandatoryFields: true
});
...
// Add additional code