首页 > 解决方案 > 扩展 Web 服务中的 Acumatica PR203000 - 系统未能提交 EmployeeAttributes 行

问题描述

我正在尝试扩展 Acumatica 的 Web 服务端点以公开 PR 模块中的对象。我将 2021R1 与销售演示数据一起使用。我添加了一个以 PR203000 为基础的顶级实体。除了该顶级实体上的一些属性之外,我还添加了一个详细实体,该实体映射到屏幕上的 TaxSettings 选项卡。具体来说,在该详细实体中,我公开了“Tax Settings”对象的 Description、State 和 Value 属性。然后我尝试使用以下 PUT 请求添加数据:

    "EmployeeID": {
        "value": "KLM"
    },

    "TaxSettings": [
        {

            "State": {
                "value": "FED"
            },
            "Description": {
                "value": "Social Security Number"
            },
            "Value": {
                "value": "123-45-6789"
            }




        }
    ]
}

但是,我收到以下错误消息:

{
    "message": "An error has occurred.",
    "exceptionMessage": "Operation failed",
    "exceptionType": "PX.Data.PXInvalidOperationException",
    "stackTrace": "..removed for brevity",
    "innerException": {
        "message": "An error has occurred.",
        "exceptionMessage": "The system failed to commit the EmployeeAttributes row.",
        "exceptionType": "PX.Data.PXException",
        "stackTrace": "   at PX.Api.SyImportProcessor.SyStep.CommitChangesInt(Object itemToBypass, PXFilterRow[] targetConditions, PXFilterRow[] filtersForAction, SyImportRowResult importResult)\r\n   at PX.Api.SyImportProcessor.SyStep.CommitChanges(Object& itemToBypass, PXFilterRow[] targetConditions, PXFilterRow[] filtersForAction)\r\n   at PX.Api.SyImportProcessor.ExportTableHelper.ExportTable()"
    }
}

不幸的是,作为 Acumatica 开发的新手,我没有发现这个错误足以提供足够的信息来查明问题。我检查了相关的 Graph 和 EmployeeAttributes DAC,但无法确定可能导致问题的原因。虽然我意识到上述 JSON 调用不包含 DAC 中所需的所有字段,但据我了解,图表调用“EmployeeAttributes.SetSettingNameForDescription”来填充这些字段,因此我认为这不是问题所在。

我是 Acumatica 的新手,所以任何关于如何排除故障的指示都会非常感激。

谢谢。

标签: c#acumatica

解决方案


推荐阅读