Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/391.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/458.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Netsuite文件柜_Java_Javascript_Netsuite - Fatal编程技术网

Java Netsuite文件柜

Java Netsuite文件柜,java,javascript,netsuite,Java,Javascript,Netsuite,我想知道是否可以使用nlapiLoadFile将服务器中的外部驱动器中的文件称为公司或本地驱动器中的服务器,而不是从文件柜中调用文件。哪些文件必须手动上载?因此,我可以使用它使用nlapiCreateCSVImport导入文件 谢谢。不。您可以使用NLAPIRestURL,它必须可以从外部服务器访问。@pipechang这是我到目前为止得到的信息,当您说我需要将消息正文转换为JSON时,我不太明白 如果我将文件作为XML拉入,那么在读取正文时是否仍需要将其转换为JSON?如果没有,我以后如何才能

我想知道是否可以使用nlapiLoadFile将服务器中的外部驱动器中的文件称为公司或本地驱动器中的服务器,而不是从文件柜中调用文件。哪些文件必须手动上载?因此,我可以使用它使用nlapiCreateCSVImport导入文件


谢谢。

不。您可以使用NLAPIRestURL,它必须可以从外部服务器访问。

@pipechang这是我到目前为止得到的信息,当您说我需要将消息正文转换为JSON时,我不太明白 如果我将文件作为XML拉入,那么在读取正文时是否仍需要将其转换为JSON?如果没有,我以后如何才能将其转换为CSV/

谢谢你的帮助

    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
}

如何使用它从vault导入csv文件。它是否类似于NLAPIRestURL..//server12/forler12321/1.csv。那么我需要请求回复吗?谢谢你的邀请help@Jamesguilford您将获得一个响应对象,您必须从中提取body属性,即csv本身。请参见帮助文件中的nlresponseobj。然后需要找到一个解析器,将响应体字符串转换为github上的JSON对象搜索。从那里它是纯JS。另外,现在我注意到您的驱动器是本地的,您必须使此文档网站可用,因为NetSuite服务器无法看到您的本地网络。。把它放在ftp服务器或其他什么地方。有趣的是……那么我如何将JSON转换回CSV进行导入呢@pipechang@Jamesguilford试试这个,它是一个节点库,但当然可以用作普通的js。您可以在Netsuite的脚本调试器中运行函数内容。