Dynamics CRM 2013:审核日志有“空白”记录

2024-05-14

On a custom entity I enabled a single field for auditing which seems to be working fine. But there are many, many more audit records having changed date, changed by (both user and service accounts) and event of Update but blank changed field, old value and new value columns. Opening one of these "blank" records shows the message given in the title. example from a record

当您打开其中一个时,您看到的不是表格,而是语句“此操作更改的字段未启用审计跟踪”。

是的,我知道。除其中一个字段外,所有字段均未启用审核跟踪。显然,这些是由插件或工作流程生成的事件。

为什么它给我这些以及我该如何让它停止?


为什么它给我这些

因为字段正在更新。正如您提到的,这可能是通过插件或工作流程实现的。

当插件忘记实例化新字段时,它们经常会错误地更新字段Entity并只给它更新必要的属性:

实例化一个新实体

var smallEntity = new Entity { Id = new Guid("entityId"), LogicalName = "entityName" };
smallEntity["firstname"] = "newName";
...
service.Update(smallEntity);

不必要地更新所有字段

var bigEntity = service.Retrieve(new Guid("entityId"), "entityName", new ColumnSet(true));
bigEntity["firstname"] = "newName";
...
service.Update(bigEntity);

smallEntity仅包含一个属性。什么时候Update被调用时,审核历史记录将仅显示一个字段已更新。

bigEntity包含每个实体属性,因为它是使用检索的new ColumnSet(true). When Update被调用时,审核历史记录将显示所有字段已更新,即使只有"firstname"实际上已经改变了。

我该如何让它停止?

一种选择是过滤审核历史记录视图以仅显示您感兴趣的字段:

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Dynamics CRM 2013:审核日志有“空白”记录 的相关文章

随机推荐