简体   繁体   English

Netsuite文件柜

[英]Netsuite File cabinet

I was wondering if it would be possible to use nlapiLoadFile() to call a file from an external drive in the server (A server within the company or local drive) and not from the file cabinet. 我想知道是否可以使用nlapiLoadFile()从服务器(公司或本地驱动器内的服务器)中的外部驱动器而不是文件柜中调用文件。 (which the file has to be uploaded manually)? (必须手动上传哪个文件)? So I can use it to import the file using nlapiCreateCSVImport(). 因此,我可以使用它使用nlapiCreateCSVImport()导入文件。

Thank you. 谢谢。

不能。您可以使用nlapiRequestURL,必须从外部服务器进行访问。

@pipechang Here's what I got so far, I can't quite understand it when U say I need to convert the body of the message to JSON What If I pull in the file as XML, then do i still need to convert it to JSON when I read the body ? @pipechang到目前为止,这是我得到的,当您说我需要将消息的主体转换为JSON时,我还不太明白。如果我将文件作为XML提取,那么我还需要将其转换为JSON吗?我什么时候读身体? If not, how would i then be able to transform it into a CSV later on?/ 如果没有,我以后如何将其转换为CSV?/

Thanks for your help. 谢谢你的帮助。

    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
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM