Reference

SuiteScript 1.0 to 2.1: the nlapi functions and what replaces them

Every common SuiteScript 1.0 function, the SuiteScript 2.1 module method that replaces it, and the differences that make a straight translation fail. Pick a function for a before and after example.

SuiteScript 1.0SuiteScript 2.1Module
nlapiLoadRecordrecord.loadN/record
nlapiCreateRecordrecord.createN/record
nlapiSubmitRecordrecord.saveN/record
nlapiSubmitFieldrecord.submitFieldsN/record
nlapiLookupFieldsearch.lookupFieldsN/search
nlapiDeleteRecordrecord.deleteN/record
nlapiTransformRecordrecord.transformN/record
nlapiSearchRecordsearch.createN/search
nlapiLoadSearchsearch.loadN/search
nlapiGetFieldValuegetValueN/currentRecord or context.newRecord
nlapiSetFieldValuesetValueN/currentRecord or context.newRecord
nlapiGetFieldTextgetTextN/currentRecord or context.newRecord
nlapiGetLineItemCountgetLineCountN/currentRecord or N/record
nlapiGetLineItemValuegetSublistValueN/record
nlapiSetLineItemValuesetSublistValueN/record
nlapiSelectNewLineItemselectNewLineN/currentRecord or dynamic N/record
nlapiGetNewRecordcontext.newRecordEntry point context
nlapiLogExecutionlog.debug / log.audit / log.errorN/log
nlapiGetContextruntime.getCurrentScript / runtime.getCurrentUserN/runtime
nlapiScheduleScripttask.createN/task
nlapiYieldScriptMap/Reduce scriptN/task or a Map/Reduce script type
nlapiSendEmailemail.sendN/email
nlapiRequestURLhttps.get / https.post / https.requestN/https
nlapiResolveURLurl.resolveRecord / url.resolveScriptN/url
nlapiStringToDateformat.parse / format.formatN/format
nlapiLoadFilefile.loadN/file
nlapiCreateErrorerror.createN/error

Oracle’s full API map lists every 1.0 function. Some have no 2.1 equivalent and need a redesign rather than a translation.

Find what still needs converting

See which of your scripts still call these functions

SuiteMigrate scans the NetSuite account you are signed in to and lists every active 1.0 and 2.0 script, with which ones you can read and which are locked in bundles. Free, no card.

Add to Chrome — freeRead the migration guide