0

令我惊讶的是,我没有在 InvenItemService 上找到标准的更新和删除操作。因此,为了满足我们客户的要求,我运行了 AIF 更新向导并添加了这两个操作。我认为这很容易,并且发现这样做的过程非常快。在此之前,我将 AxdItem 查询的更新属性设置为 Yes。后来,在调试更新操作时,我想我必须相应地修改 AxdItem 类的 updateList() 和 Update() 方法以提供方法定义。

public AifResult updateList(    AifEntityKeyList _entityKeyList,
                                AifDocumentXml _xml,
                                AifEndpointActionPolicyInfo _actionPolicyInfo,
                                AifConstraintListCollection _constraintListCollection)
{
    //throw error(strFmt("@SYS94920"));
    return super(_entityKeyList, _xml, _actionPolicyInfo, _constraintListCollection);
}
AifResult update(   AifEntityKey _entityKey ,
                    AifDocumentXml _xml,
                    AifEndpointActionPolicyInfo _actionPolicyInfo,
                    AifConstraintList _constraintList)
{
    //throw error(strFmt("@SYS94920"));
    return super(_entityKey, _xml, _actionPolicyInfo, _constraintList);
}

现在,在尝试更新 AX 中的现有项目时,我遇到了 AIF 异常。

无法在物料销售订单设置 (InventItemSalesSetup) 中编辑记录。操作无法完成,因为没有选择记录进行更新。记住 TTSBEGIN/TTSCOMMIT 以及 FORUPDATE 子句。

然后我更改了 AxdItem Query 上所有子数据源的更新属性并重新运行向导。再次运行 CIL,现在得到以下异常。

无法在物料销售订单设置 (InventItemSalesSetup) 中编辑记录。由于另一个用户进程删除记录或更改记录中的一个或多个字段而发生更新冲突。

有什么建议/想法吗?

我尝试了几件事并花费了太多时间但失败了。

4

1 回答 1

1

好像您正在尝试更新已在类方法removeDefaultItemOrderSetup中删除的记录AxdItem

在此处输入图像描述

这会给你一个提示会发生什么 https://dynamicsuser.net/ax/f/developers/72116/aif-update-cannot-be-run-twice

于 2017-01-04T09:12:19.037 回答