【发布时间】:2014-09-26 21:28:23
【问题描述】:
我正在尝试将 CSV 文件自动导入 Netsuite 。 (例如,我希望 netsuite 每晚检查一次特定的根文件夹,然后将这些 CSV 文件拉入或导入到 Netsuite。例如,我希望将一些 BOM 信息导入并映射到 Netsuite 变量?
这可能吗?如果没有,我是否至少能够通知用户特定文件夹中有一个新文件等待导入?
p.s 我可以导入常规的 xls 文件而不是 csv 吗?
感谢您的所有帮助。
干杯,
詹姆斯
更新这是我目前所拥有的,不确定它是否可以像 SuiteScript 和 Portlet 一样工作
function scheduledimporting(type){
var csvMap = '15'; //saved CSV import id
//var csvFile = nlapiLoadFile("5828"); //csv file id from filecabinet
var urlrequest=nLapiRequestURL('https://...........',null,a);
var body=response.getBody(); //get the body of the message
var csvImport = nlapiCreateCSVImport();//creating a new csv import
/***
If the file that I'm pulling in is a CSV, would i get the body as CSV?
DO I still need to go through Prsing the body and transform it to JSON Object
If I do, how would I transfer it back to CSV ?
***/
csvImport.setMapping(csvMap);//setting import map
csvImport.setPrimaryFile(body.getValue());//file to be imported
csvImport.setOption("jobName", "Test1111");//setting job status' job name
var csvSubmitId = nlapiSubmitCSVImport(csvImport);//submitting the CSV
}
【问题讨论】:
标签: javascript csv import netsuite erp