Acumatica:JSON 更新销售发票中用户定义的字段值

Acumatica: JSON to Update User Defined Field Value in SalesInvoice

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

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

screenshot

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

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

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

请查看以下帮助文章: 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"
            }
        }
    }
}