Create an item receipt from a purchase order
This sample is a custom module script that creates an item receipt from a purchase order. This is either a custom module or an individual function within a user event or other server script, so no JSDoc or define statement or return statement or entry point function is needed. But you will need to load the N/record and N/email modules for the function to work.
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
nlapiTransformRecord
function is changed to therecord.transform
method. -
The
getLineItemValue
function is changed to theRecord.getSublistValue
method. -
The
setLineItemValue
function is changed to theRecord.setSublistValue
method. -
The
nlapiSubmitRecord
function is changed to theRecord.save
method. -
The
nlapiSendEmail
function is changed to theemail.send
method.
SuiteScript 1.0 Script |
SuiteScript 2.1 Script |
---|---|
|
|