Modules
Objects/Functions
SuiteScript 2.0
{record}.delete.promise({type: {string*},id: {number | string*}}).then(function(response){// DO SOMETHING WITH RESPONSE HERE}, function(error){// DO SOMETHING WITH ERROR HERE});
N/record Module
record.delete.promise()
Method Description:
Deletes a record asynchronously.
The parameters and errors thrown for this method are the same as those for record.delete(options). For more information on promises, see Promise Object.
Returns:
Promise Object
Supported Script Types:
Client-side scripts
For more information, see SuiteScript 2.0 Client Script Type.
Governance:
Transaction records: 20 units
Custom records: 4 units
All other records: 10 units
Module:
N/record Module
Since:
2015.2
Search NetSuite -
https://system.netsuite.com/app/help/helpcenter.nl?search=record.delete.promise(options)
Example:
// Code Example 1
// 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
//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4440823302.html