【问题标题】:Acumatica: JSON to Update User Defined Field Value in SalesInvoiceAcumatica:用于更新 SalesInvoice 中用户定义字段值的 JSON
【发布时间】:2020-08-28 19:19:26
【问题描述】:

有没有办法在 SalesInvoice 中动态填充用户定义的字段值。我正在使用 REST API,我需要 JSON 示例来为字段添加值。

我正在使用它来更新字段。

screenshot

{
  "Attributes": [
    {
      "AttributeID": {
        "value": "testattributeid"
      },
      "Required": {
        "value": false
      },
      "Value": {
        "value": "testvalue"
      }
    }
  ]
}

【问题讨论】:

    标签: json acumatica erp invoice acumatica-kb


    【解决方案1】:

    请查看以下帮助文章: https://help-2020r1.acumatica.com/(W(27))/Help?ScreenId=ShowWiki&pageid=c5e2f36a-0971-4b33-b127-3c3fe14106ff

    您可以使用 $custom 参数检索用户定义字段,如下所示: GET: {{sitename}}/entity/Default/18.200.001/SalesOrder?$custom=Document.AttributeCOLOR

    关于更新记录,请查看这篇文章: https://help-2020r1.acumatica.com/(W(27))/Help?ScreenId=ShowWiki&pageid=7b104d41-3457-42f8-8010-165d9d931d3f

    您可以像这样更新记录中的自定义字段:

    PUT: {{sitename}}/entity/Default/18.200.001/SalesOrder
    BODY:
    {       
        "Description": {
            "value": "TEST"
        },
        "OrderNbr": {
            "value": "SO005435"
        },
        "OrderType": {
            "value": "SO"
        },
        "custom": {
            "Document": {
                "AttributeCOLOR": {
                    "type": "CustomStringField",
                    "value": "BLACK"
                }
            }
        }
    }
    

    【讨论】:

      【解决方案2】:

      用户定义的字段存储在以“KvExt”为后缀的表中。不幸的是,这些表不是通过 DAC 定义的。为了包含用户定义的字段,我没有找到扩展端点的方法。

      一个选项:创建一个映射到表 SOOrderKvExt 的 DAC。然后将数据视图添加到返回字段的 SOOrder 条目图。两个 DAC 之间的 PK 链接是 RecordID。在图表中添加视图后,您可以扩展端点以包含字段(ValueNumeric、ValueDate、ValueString 等)。这些字段是用户定义的字段。扩展端点后,您可以通过 REST 更新用户定义字段。

      【讨论】:

      • 我不建议将 KvExt 表映射到 DAC。
      猜你喜欢
      • 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
      相关资源
      最近更新 更多