【问题标题】:How do I call NetSuite SuiteTalk inventoryitem add using list name for StringCustomFieldRef value instead of internalID?如何使用 StringCustomFieldRef 值的列表名称而不是 internalID 调用 NetSuite SuiteTalk inventoryitem add?
【发布时间】:2019-09-18 20:56:48
【问题描述】:

当通过 API 添加新的清单项时,我们需要填写一些基于列表的自定义字段。我希望能够使用该字段的字符串值,但是当我尝试调用错误时。

我们有一个包含两个值的自定义列表: InternalId 1 是“LTL” InternalId 2 是“FedEx”

我尝试将值作为 StringCustomFieldRef 发送,当将值设置为“LTL”的字符串值时,我们得到一个无效的 ref 错误。当将值设置为 1 的 internalId 时,它可以工作。

我还尝试使用 SelectCustomFieldRef,当将 value->name 设置为“LTL”的字符串值时,它会出错,就像我们根本没有传递值一样。当我们将 value->internalId 设置为 1 时,它会起作用。

是否可以只传入字符串值?

不起作用:

                $customField1 = new StringCustomFieldRef();
                $customField1 ->value = "LTL";
                $customField1 ->scriptId = 'custitem_zu_zu_fulfill_pref';

作品:

                $customField1 = new StringCustomFieldRef();
                $customField1 ->value = "1";
                $customField1 ->scriptId = 'custitem_zu_zu_fulfill_pref';

这是错误响应:

<platformCore:statusDetail type="ERROR">
    <platformCore:code>INVALID_KEY_OR_REF</platformCore:code>
    <platformCore:message>Invalid custitem_zu_zu_fulfill_pref reference key LTL.</platformCore:message>
</platformCore:statusDetail>

【问题讨论】:

    标签: netsuite suitetalk


    【解决方案1】:

    不,很遗憾,您不能使用Name 值设置字段——您必须使用internalId。如果您的自定义字段是基于列表的,那么您应该使用SelectCustomFieldRefMultiSelectCustomFieldRef

    如果您希望使用Name 值,您可以执行CustomListSearchBasic 以获取每个项目的NameinternalId,并将其与您选择的名称相匹配。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多