Implement End of Month Sales Order Promotions
This sample is a user event script that implements end of month sales order promotions.
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/currentRecord, N/runtime, and N/ui/serverWidget modules -
The
returnstatement is added with thebeforeLoadentry point -
The
nlapiGetContextfunction is changed to thecontext.UserEventTypeproperty. -
The
getExecutionContextfunction is changed to theruntime.executionContextproperty. -
The
nlapiLogExecutionfunction is changed to thelog.debutmethod. -
The
formfunction parameter is changed to theformcontext component.
|
SuiteScript 1.0 Script |
SuiteScript 2.1 Script |
|---|---|
|
|