SuiteScript 1.0 to 2.1 reference

nlapiGetFieldText in SuiteScript 2.1

In SuiteScript 2.1, nlapiGetFieldText is replaced by getText from N/currentRecord or context.newRecord. Reads the display text of a select field.

Before and after

// SuiteScript 1.0
var termsName = nlapiGetFieldText('terms');
// SuiteScript 2.1
const termsName = context.newRecord.getText({ fieldId: 'terms' });

What to watch for

  • On a record in standard mode, read the text before changing the value with setValue in the same script, or set it with setText instead.

Related functions

Find what still needs converting

Find every script that still calls nlapiGetFieldText

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.