SuiteScript 1.0 to 2.1 reference

nlapiResolveURL in SuiteScript 2.1

In SuiteScript 2.1, nlapiResolveURL is replaced by url.resolveRecord / url.resolveScript from N/url. Builds a NetSuite URL to a record, Suitelet or RESTlet.

Before and after

// SuiteScript 1.0
var link = nlapiResolveURL('SUITELET', 'customscript_portal', 'customdeploy_portal');
var view = nlapiResolveURL('RECORD', 'salesorder', 123);
// SuiteScript 2.1
define(['N/url'], (url) => {
  const link = url.resolveScript({ scriptId: 'customscript_portal', deploymentId: 'customdeploy_portal' });
  const view = url.resolveRecord({ recordType: 'salesorder', recordId: 123 });
});

What to watch for

  • Pass returnExternalUrl: true to get the external URL of an available-without-login Suitelet.

Related functions

Find what still needs converting

Find every script that still calls nlapiResolveURL

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.

Add to Chrome — freeRead the migration guide

Examples are simplified. Test converted code in a NetSuite sandbox before deploying. SuiteMigrate is not affiliated with Oracle or NetSuite.