【问题标题】:In Netsuite REST, how do I assign an item location to an item line in a sales order?在 Netsuite REST 中,如何将项目位置分配给销售订单中的项目行?
【发布时间】:2020-07-06 15:08:07
【问题描述】:

我正在使用 Netsuite 的 Postman 集合(负责处理 Oauth1 的内容),并且正在发布到此端点:

{{proto}}://{{host}}/rest/platform/{{version}}/record/salesorder

...身体是这样的:

{
  "customForm": "999",
  "entity": {
    "id": "1111"
  },
  "department": {
    "id": "2222"
  },
  "subsidiary": {
    "id": "33"
  },
  "otherRefNum": "TEST-PO",
  "location": {
    "id": "444"
  },
  "item": {
    "items": [
        {
          "item": { "id": "555555" },
          "inventorylocation": {  "id": "444" },
          "price": { "id": "-1" },
          "grossAmt": 999,
          "quantity": 1
        }
    ]
  }
}

我正在尝试在项目级别分配位置。如果我删除了inventorylocation 行,上述请求会创建一个销售订单(没有行级位置分配),但是在那里,我得到这个错误:Unknown reference or subrecord field inventorylocation in request body.

Netsuite 的 REST API 文档在这里: https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2019.2/index.html#tag-salesorder

我也尝试过替换 location 并稍微移动字段,但没有成功。 (要么在没有行级位置分配的情况下创建销售订单,要么我收到与上述错误类似的错误。

有什么想法吗?

【问题讨论】:

    标签: rest netsuite suitetalk


    【解决方案1】:

    从您链接的文档中,您需要的字段 id 似乎是 inventorylocation 而不是 itemlocation

    salesorder-itemElement

    ...
    giftCertRecipientName 收件人姓名:字符串
    id [缺少标签:id]:字符串
    inventorydetail:salesorder-item-inventorydetail
    inventorylocation:location
    库存子公司:子公司
    isClosed 关闭:布尔
    ...

    【讨论】:

    【解决方案2】:

    基于the documentationsalesOrder-itemElement,看起来该密钥是正确的。

    您尝试过"location": "{ID}" 变体吗?

    LedgerSync 中,创建发票的请求似乎在此正文中产生:

    {
        "entity": "309",
        "location": "1",
        "sublist": {
            "items": [
                {
                    "amount": 12345,
                    "description": "Test Line Item FLURYAOLJLFADYGR-1"
                },
                {
                    "amount": 12345,
                    "description": "Test Line Item FLURYAOLUFUTBYJD-2"
                }
            ]
        }
    }
    

    还有一个salesOrder-item-inventorydetail 对象也包含一个location。也许你可以像这样使用那个:

    {
      "customForm": "999",
      "entity": {
        "id": "1111"
      },
      "department": {
        "id": "2222"
      },
      "subsidiary": {
        "id": "33"
      },
      "otherRefNum": "TEST-PO",
      "location": {
        "id": "444"
      },
      "item": {
        "items": [
            {
              "item": { "id": "555555" },
              "inventorydetail": {
                "location": "444"
              },
              "price": { "id": "-1" },
              "grossAmt": 999,
              "quantity": 1
            }
        ]
      }
    }
    

    【讨论】:

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