Set default fields values on a record
This sample is a client script that sets default field values on a record.
The conversion of this script from SuiteScript 1.0 to SuiteScript 2.1 includes the following:
-
JSDoc tags are added at the top of the script to indicate the script version and script type.
-
The
definestatement is added which imports the N/record module. -
The
returnstatement is added to thepageInitentry point. -
A record is loaded using the
record.loadmethod -
The
nlapiGetFieldValuefunction is changed to theRecord.getValuemethod. -
The
nlapiGetFieldTextfunction is changed to theRecord.getTextmethod. -
The
nlapiSetFieldTextfunction is changed to theRecord.setTextmethod.
|
SuiteScript 1.0 Script |
SuiteScript 2.1 Script |
|---|---|
|
|