SuiteScript 1.0 to 2.1 reference
nlapiSubmitRecord in SuiteScript 2.1
In SuiteScript 2.1, nlapiSubmitRecord is replaced by record.save from N/record. Saves a record and returns its internal id.
Before and after
// SuiteScript 1.0
var id = nlapiSubmitRecord(rec, true, false);// SuiteScript 2.1
const id = rec.save({ enableSourcing: true, ignoreMandatoryFields: false });What to watch for
- save() is a method on the record, not a module function.
- The two booleans from 1.0 map to enableSourcing and ignoreMandatoryFields, in that order.
Related functions
- nlapiSubmitField becomes record.submitFields
- nlapiLookupField becomes search.lookupFields
- nlapiDeleteRecord becomes record.delete
- All SuiteScript 1.0 functions
Find what still needs converting
Find every script that still calls nlapiSubmitRecord
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.