record.delete(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Deletes a record.

Note:

For the promise version of this method, see record.delete.promise(options). Note that promises are only supported in client scripts.

Returns

The internal ID of the deleted record.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

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 deleting an instance of a standard NetSuite record type, set this value by using the record.Type enum.

  • When deleting 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 record instance to be deleted.

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 script example, see N/record Module Script Samples.

          // Add additional code
...
// Delete a sales order
var salesOrderRecord = record.delete({
    type: record.Type.SALES_ORDER,
    id: 88,
});

// Delete an instance of a custom record type with the ID customrecord_feature 
var featureRecord = record.delete({
    type: 'customrecord_feature',
    id: 3,
}); 
...  
// Add additional code 

        

Related Topics

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

General Notices