record.delete.promise(options)
Method Description |
Deletes a record asynchronously.
Note:
The parameters and errors thrown for this method are the same as those for record.delete(options). For more information about promises, see Promise Object. |
Returns |
|
Synchronous Version |
|
Supported Script Types |
Client 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 promise script example, see Promise Object.
// Add additional code
// Delete an instance of a standard NetSuite record
...
function deleteRecord() {
var deleteRecordPromise = record.delete.promise({
type: record.Type.PHONE_CALL,
id: 109
});
// To delete an instance of a custom record type, use
// the string ID in the type field. For example:
// type: 'customrecord_feature'
deleteRecordPromise.then(function() {
log.debug({
title: 'Success',
details: 'Record successfully deleted'
});
// Add any other needed code that should execute
// after the record is deleted.
}, function(e) {
log.error({
title: 'Unable to delete record',
details: e.name
});
});
}
...
// Add additional code