Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.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
NetSuite API-如何将跟踪号发送回发票或销售订单?_Api_Updates_Shipping_Netsuite - Fatal编程技术网

NetSuite API-如何将跟踪号发送回发票或销售订单?

NetSuite API-如何将跟踪号发送回发票或销售订单?,api,updates,shipping,netsuite,Api,Updates,Shipping,Netsuite,我正在通过SOAP API将一个配送解决方案与NetSuite集成。我可以通过searchRecord调用检索shipAddress。现在我需要将跟踪号、使用的服务和成本发送回NetSuite。希望有人能给我指出正确的方向,因为搜索并没有为我找到任何答案。一个XML示例会很好。我几乎将外部开发人员尝试实现的内容粘贴为响应,但我不知道如何设置信封,以便在NS中的记录中接收它……我认为这就是处理更新发布到字段的原因: ' var a = new Array();

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

我几乎将外部开发人员尝试实现的内容粘贴为响应,但我不知道如何设置信封,以便在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;
'

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

[爪哇]

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#]

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


这应该有助于你开始

您需要使用
update
操作来更新要更改的记录的字段。您使用的是什么语言?我需要生成原始XML。我正在使用VBScript。这是一项业务需求。VBScript是唯一的选项。
var so = new SalesOrder();
so.externalId = "externalID";
...set_other_fields_as_required...
var wr = Service.upsert(so);