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.0 | SuiteScript 2.1 | Module |
|---|---|---|
| nlapiLoadRecord | record.load | N/record |
| nlapiCreateRecord | record.create | N/record |
| nlapiSubmitRecord | record.save | N/record |
| nlapiSubmitField | record.submitFields | N/record |
| nlapiLookupField | search.lookupFields | N/search |
| nlapiDeleteRecord | record.delete | N/record |
| nlapiTransformRecord | record.transform | N/record |
| nlapiSearchRecord | search.create | N/search |
| nlapiLoadSearch | search.load | N/search |
| nlapiGetFieldValue | getValue | N/currentRecord or context.newRecord |
| nlapiSetFieldValue | setValue | N/currentRecord or context.newRecord |
| nlapiGetFieldText | getText | N/currentRecord or context.newRecord |
| nlapiGetLineItemCount | getLineCount | N/currentRecord or N/record |
| nlapiGetLineItemValue | getSublistValue | N/record |
| nlapiSetLineItemValue | setSublistValue | N/record |
| nlapiSelectNewLineItem | selectNewLine | N/currentRecord or dynamic N/record |
| nlapiGetNewRecord | context.newRecord | Entry point context |
| nlapiLogExecution | log.debug / log.audit / log.error | N/log |
| nlapiGetContext | runtime.getCurrentScript / runtime.getCurrentUser | N/runtime |
| nlapiScheduleScript | task.create | N/task |
| nlapiYieldScript | Map/Reduce script | N/task or a Map/Reduce script type |
| nlapiSendEmail | email.send | N/email |
| nlapiRequestURL | https.get / https.post / https.request | N/https |
| nlapiResolveURL | url.resolveRecord / url.resolveScript | N/url |
| nlapiStringToDate | format.parse / format.format | N/format |
| nlapiLoadFile | file.load | N/file |
| nlapiCreateError | error.create | N/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.