SuiteScript 1.0 to 2.1 reference
nlapiDeleteRecord in SuiteScript 2.1
In SuiteScript 2.1, nlapiDeleteRecord is replaced by record.delete from N/record. Deletes a record by type and id.
Before and after
// SuiteScript 1.0
nlapiDeleteRecord('customrecord_log', 77);// SuiteScript 2.1
define(['N/record'], (record) => {
record.delete({ type: 'customrecord_log', id: 77 });
});What to watch for
- Same governance cost class as in 1.0. Wrap in try/catch if the record may already be gone.
Related functions
- nlapiTransformRecord becomes record.transform
- nlapiSearchRecord becomes search.create
- nlapiLoadSearch becomes search.load
- All SuiteScript 1.0 functions
Find what still needs converting
Find every script that still calls nlapiDeleteRecord
SuiteMigrate lists the active 1.0 and 2.0 scripts in your NetSuite account, shows which ones you can read and which are locked, and drafts 2.1 conversions you review before deploying. Free for 5 conversions.
Examples are simplified. Test converted code in a NetSuite sandbox before deploying. SuiteMigrate is not affiliated with Oracle or NetSuite.