using scheduled script we can automate csv import.The file to be imported will be stored in the filecabinet.
Solution:
Step 1: a) Create a Field Map for the CSV File
Note: Field Mapping offers a 1-to-1 relationship between the fields on the CSV File and NetSuite Fields.
b) Navigate to Setup > Import/Export > Import CSV Record
c) Upload a CSV File and finish the Import Assistant Form steps
d) Mapping Field Step: Drag and drop the CSV fields to center column along with the matching NetSuite fields
e) Click Save and Run to test the Field Map in the CSV Impor
f) Check the CSV Import Status to see if it is successful
Step 2: Create a scheduled script with following code snippet
var myFile = file.load({
id: 2766 //nternal ID of the CSV file to be imported.
})
var csv = task.create({
taskType: task.TaskType.CSV_IMPORT,
mappingId: 1, //internal id of the Field Map created in Step 1
importFile: "myFile"
})
csv.submit();
Note: The supported script type for SuiteScript CSV Import is Scheduled Script