SuiteScript 1.0 to 2.1 reference
nlapiLoadRecord in SuiteScript 2.1
In SuiteScript 2.1, nlapiLoadRecord is replaced by record.load from N/record. Loads an existing record so you can read or change it.
Before and after
// SuiteScript 1.0
var rec = nlapiLoadRecord('salesorder', 123);
var total = rec.getFieldValue('total');// SuiteScript 2.1
define(['N/record'], (record) => {
const rec = record.load({ type: record.Type.SALES_ORDER, id: 123 });
const total = rec.getValue({ fieldId: 'total' });
});What to watch for
- Arguments become a single options object.
- Use record.Type enums or the string id. Custom records use 'customrecord_...' as the type.
- Pass isDynamic: true only if the 1.0 code relied on dynamic-mode sourcing.
Related functions
- nlapiCreateRecord becomes record.create
- nlapiSubmitRecord becomes record.save
- nlapiSubmitField becomes record.submitFields
- All SuiteScript 1.0 functions
Find what still needs converting
Find every script that still calls nlapiLoadRecord
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.