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 will 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
nlapiLoadFile
function is changed to thefile.load
method. -
The
nlapiCreateCSVImport
function is changed to thetask.create
method using thetask.TaskType.CSV_Import
type value. -
The
job.setMapping
function is changed to thejob.mappingId
property. -
The
job.setsetPrimaryFile
function is changed to thejob.importFile
property. -
The
job.setLinkedFile
function is changed to thejob.linkedFiles
property (which is an Object). -
The
job.setOption
function is changed to thejob.name
property. -
The
nlapiSubmitCSVImport
function is changed to thejob.submit
method.
SuiteScript 1.0 Script |
SuiteScript 2.x Script |
---|---|
|
|
|
|