record.delete(options)
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 |
|
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 record instance to be deleted. |
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 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.