Create CSV imports
This sample includes two scripts used to creates CSV imports. These samples can be used as a custom module or as 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'll need to load the N/task and N/file modules for the function to work.
The conversion of this script from SuiteScript 1.0 to SuiteScript 2.x includes the following:
-
The
nlapiLoadFilefunction is changed to thefile.loadmethod. -
The
nlapiCreateCSVImportfunction is changed to thetask.createmethod using thetask.TaskType.CSV_Importtype value. -
The
job.setMappingfunction is changed to thejob.mappingIdproperty. -
The
job.setsetPrimaryFilefunction is changed to thejob.importFileproperty. -
The
job.setLinkedFilefunction is changed to thejob.linkedFilesproperty (which is an Object). -
The
job.setOptionfunction is changed to thejob.nameproperty. -
The
nlapiSubmitCSVImportfunction is changed to thejob.submitmethod.
|
SuiteScript 1.0 Script |
SuiteScript 2.x Script |
|---|---|
|
|
|
|