SuiteScript 1.0 to 2.1 reference
nlapiLoadSearch in SuiteScript 2.1
In SuiteScript 2.1, nlapiLoadSearch is replaced by search.load from N/search. Loads a saved search so you can run it or add filters.
Before and after
// SuiteScript 1.0
var s = nlapiLoadSearch(null, 'customsearch_open_orders');
var rs = s.runSearch();// SuiteScript 2.1
define(['N/search'], (search) => {
const s = search.load({ id: 'customsearch_open_orders' });
s.run().each((result) => { /* ... */ return true; });
});What to watch for
- Add filters with s.filters.push(search.createFilter({ ... })) before running.
Related functions
- nlapiGetFieldValue becomes getValue
- nlapiSetFieldValue becomes setValue
- nlapiGetFieldText becomes getText
- All SuiteScript 1.0 functions
Find what still needs converting
Find every script that still calls nlapiLoadSearch
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.