【问题标题】:NetSuite API - How to send tracking number back to Invoice or Sales Order?NetSuite API - 如何将跟踪号发送回发票或销售订单?
【发布时间】:2013-08-15 15:58:46
【问题描述】:

我正在通过 SOAP API 将运输解决方案与 NetSuite 集成。我可以通过 searchRecord 调用检索 shipAddress。现在我需要将跟踪号、使用的服务和成本发送回 NetSuite。希望有人能指出我正确的方向,因为搜索没有为我找到任何答案。一个示例 XML 会很棒。

【问题讨论】:

  • 您需要使用update 操作来更新您要更改的记录的字段。
  • 你使用什么语言?
  • 我需要构建原始 XML。我正在使用 VBScript。这是业务需求。 VBScript 是唯一的选择。

标签: api updates shipping netsuite


【解决方案1】:

我几乎粘贴了外部开发人员尝试实现的响应作为响应,但我不明白如何设置信封以在 NS 中接收它的记录...我认为这就是处理将帖子更新到字段:

'
             var a = new Array();
                                 a['Content-Type'] = 'text/xml; charset=utf-8';
                                 a['POST'] = '/FedexNSService/Service1.asmx HTTP/1.1';
                                 a['Content-Length'] = data.length;           
                                 a['SOAPAction'] = 'https://wsbeta.fedex.com:443/web-services/ship/ReturnFedexLable';
                                nlapiLogExecution('DEBUG', 'Results', 'data : ' + data);



            var response = nlapiRequestURL('http://sonatauat.adaaitsolutions.com/FedexNSService/Service1.asmx?op=ReturnFedexLable', data, a, null,null);
nlapiLogExecution('DEBUG', 'response', response);                
            var responseXML = nlapiStringToXML(response.getBody());
nlapiLogExecution('DEBUG', 'responseXML', responseXML);
                                 var responseCode = response.getCode();
nlapiLogExecution('DEBUG', 'responseCode', responseCode);
                                 var body = response.getBody();
nlapiLogExecution('DEBUG', 'body', body);                                
                                 nlapiLogExecution('DEBUG', 'responseXML '+responseXML, 'responseCode : ' + responseCode);
                                 nlapiLogExecution('DEBUG', 'body ', 'body : ' +body);
                        var imageurl ='';        
                    if(responseXML != null)
                    {

                            var rawfeeds = nlapiSelectNodes(responseXML, "//Tracking"); 
                            var FileInternalId = nlapiSelectValue(rawfeeds[0], "FileInternalId");
                            var TrackingIds = nlapiSelectValue(rawfeeds[1], "TrackingIds");
                            nlapiLogExecution('DEBUG', 'FileInternalId '+FileInternalId, 'TrackingIds : '+TrackingIds );    
                            if(FileInternalId)
                            {
                                var image=nlapiLoadFile(5985);
                                imageurl=image.getURL();
                                imageurl = ("https://system.netsuite.com"+imageurl);       
                                nlapiLogExecution('DEBUG','image',imageurl);
                            }

                    }
            return imageurl;
'

【讨论】:

    【解决方案2】:

    为了通过 SOAP 使用信息更新销售订单,您需要创建一个销售订单对象,设置值并调用 updateupsert 方法:

    [JAVA]

    SalesOrder so = new SalesOrder();
    so.setExternalId("externalID"); //This should correspond to the previous external ID for updates. 
    ...set_other_fields_as_required...
    WriteResponse wr = ns.getPort().update(so);    //ns = _port if you're using the samples                 
    

    [C#]

    var so = new SalesOrder();
    so.externalId = "externalID";
    ...set_other_fields_as_required...
    var wr = Service.upsert(so); 
    

    PHP 应该是类似的,但是我没有使用过 PHP 工具包,所以我不能肯定地说。

    这应该可以帮助您入门。

    【讨论】:

      猜你喜欢
      • 2021-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-08
      相关资源
      最近更新 更多