如何在NetSuite上列出运送方式? [英] How to list shipping methods on NetSuite?

查看:70
本文介绍了如何在NetSuite上列出运送方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过API列出发货项目(UPS,FedEx等).如会计>装运物品>清单所示. >

ItemFulfillment记录的文档建议我使用操作 GetSelectValue 列出shipMethod可能的值(与Ship Items相同).

GetSelectValue 的文档(第125页)描述了我需要使用的SOAP请求:

  <env:Body>
    <platformMsgs:getSelectValue>
      <fieldName fieldType="sales_salesOrder_shipMethod"/>
    </platformMsgs:getSelectValue>
  </env:Body>

但是它不起作用,似乎 fieldType 是错误的.

    <soapenv:Fault>
      <faultcode>soapenv:Server.userException</faultcode>
      <faultstring>org.xml.sax.SAXException: fieldType not found on {urn:core_2013_2.platform.webservices.netsuite.com}GetSelectValueFieldDescription</faultstring>
      <detail>
        <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">partners-java10005.bos.netledger.com</ns1:hostname>
      </detail>
    </soapenv:Fault>

我在哪里可以找到正确的 fieldType 以获得运输项目的列表?

解决方案

由于这篇文章,我得以提出一个C#解决方案.

var methods = new Hashtable();
var shipMethodFieldDesc = new GetSelectValueFieldDescription()
{
    field = "shipmethod",
    recordType = RecordType.estimate,
    recordTypeSpecified = true
};

// make connection.    

var result = connection.Service.getSelectValue(shipMethodFieldDesc, 0);
if (result.status.isSuccess)
{
    for (var i = 0; i < result.totalRecords; i++)
    {
       // cast to RecordRef 
       var itemRef = (RecordRef)result.baseRefList[i];

       methods.Add(itemRef.internalId, itemRef.name);
    }
}

I'm trying to list Ship Items (UPS, FedEx, etc..) via API. As it shows in Accounting > Shipping Items > List.

The documentation for the ItemFulfillment Record suggests that I use the operation GetSelectValue to list the shipMethod possible values (same as Ship Items).

The documentation for GetSelectValue (page 125) describes the SOAP request I need to use:

  <env:Body>
    <platformMsgs:getSelectValue>
      <fieldName fieldType="sales_salesOrder_shipMethod"/>
    </platformMsgs:getSelectValue>
  </env:Body>

But it's not working, it seems that the fieldType is wrong.

    <soapenv:Fault>
      <faultcode>soapenv:Server.userException</faultcode>
      <faultstring>org.xml.sax.SAXException: fieldType not found on {urn:core_2013_2.platform.webservices.netsuite.com}GetSelectValueFieldDescription</faultstring>
      <detail>
        <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">partners-java10005.bos.netledger.com</ns1:hostname>
      </detail>
    </soapenv:Fault>

Where can I find the correct fieldType to get a list of the Ship Items?

解决方案

Thanks to this post, I was able to come up with a C# solution.

var methods = new Hashtable();
var shipMethodFieldDesc = new GetSelectValueFieldDescription()
{
    field = "shipmethod",
    recordType = RecordType.estimate,
    recordTypeSpecified = true
};

// make connection.    

var result = connection.Service.getSelectValue(shipMethodFieldDesc, 0);
if (result.status.isSuccess)
{
    for (var i = 0; i < result.totalRecords; i++)
    {
       // cast to RecordRef 
       var itemRef = (RecordRef)result.baseRefList[i];

       methods.Add(itemRef.internalId, itemRef.name);
    }
}

这篇关于如何在NetSuite上列出运送方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆