You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过NetSuite SOAP API检索指定类别及无类别供应商

修改NetSuite SOAP API搜索请求以包含未分类供应商

要同时获取类别为13/20和未分配类别的供应商,你需要使用NetSuite搜索的OR逻辑,将两种类别条件组合起来。以下是修改后的请求片段:

<platformCore:search xsi:type="platformMsgs:SearchRequest"
                     xmlns:platformCore="urn:core_2024_2.platform.webservices.netsuite.com"
                     xmlns:platformMsgs="urn:messages_2024_2_2.platform.webservices.netsuite.com"
                     xmlns:platformCommon="urn:common_2024_2.platform.webservices.netsuite.com"
                     xmlns:listRel="urn:relationships_2024_2.lists.webservices.netsuite.com">
    <platformMsgs:searchRecord xsi:type="listRel:VendorSearch">
        <!-- 使用searchOr实现OR逻辑,组合两组搜索条件 -->
        <platformMsgs:searchOr>
            <!-- 第一组:修改时间在指定日期后,且类别为13或20 -->
            <platformCommon:VendorSearchBasic>
                <lastModifiedDate xsi:type="platformCore:SearchDateField" operator="after">
                    <searchValue xsi:type="xsd:dateTime">2026-01-06T00:00:00Z</searchValue>
                </lastModifiedDate>
                <category xsi:type="platformCore:SearchMultiSelectField" operator="anyOf">
                    <searchValue xsi:type="platformCore:RecordRef" internalId="13"></searchValue>
                    <searchValue xsi:type="platformCore:RecordRef" internalId="20"></searchValue>
                </category>
            </platformCommon:VendorSearchBasic>
            <!-- 第二组:修改时间在指定日期后,且未分配类别 -->
            <platformCommon:VendorSearchBasic>
                <lastModifiedDate xsi:type="platformCore:SearchDateField" operator="after">
                    <searchValue xsi:type="xsd:dateTime">2026-01-06T00:00:00Z</searchValue>
                </lastModifiedDate>
                <category xsi:type="platformCore:SearchMultiSelectField" operator="isNull"></category>
            </platformCommon:VendorSearchBasic>
        </platformMsgs:searchOr>
    </platformMsgs:searchRecord>
</platformCore:search>

关键修改说明:

  • 新增<platformMsgs:searchOr>节点:NetSuite通过该节点实现多个搜索条件的OR逻辑,只要满足其中一组条件的供应商就会被返回。
  • 两组VendorSearchBasic分别定义两种场景:
    1. 保留原有的「修改时间+指定类别」条件,匹配已分类为13/20的供应商。
    2. 添加「修改时间+类别为空」条件,匹配未分配类别的供应商。
  • 第二组中category的operator设为isNull,无需指定searchValue,用于筛选无类别字段的供应商。

这种方式会自动排除不属于13/20且已分配其他类别的供应商,完全符合你的需求。

内容的提问来源于stack exchange,提问作者Marius

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.11 18:05:08