Dynamics CRM 2013:审核日志中有“空白"记录 [英] Dynamics CRM 2013: Audit logs have "blank" records

查看:65
本文介绍了Dynamics CRM 2013:审核日志中有“空白"记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个自定义实体上,我启用了一个用于审核的单一字段,该字段似乎运行良好.但是,还有很多审计记录已更改日期,更改了(用户帐户和服务帐户)以及更新事件,但空白更改字段,旧值和新值列.打开这些空白"记录之一将显示标题中给出的消息.

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.

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

And when you open one of them what you see is no table but the statement "the fields changed by this action are not enabled for audit tracking".

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

Yeah, I know. All but one of the fields is not enabled for audit tracking. Clearly these are events generated by a plugin or workflow.

为什么要给我这些东西,如何使它停止?

Why is it giving me these and how do I make it stop?

推荐答案

为什么给我这些

因为这些字段正在更新.如您所述,这很可能是由插件或工作流程引起的.

Because the fields are being updated. As you mention this is likely by a plugin or a workflow.

插件在忘记实例化一个新的 Entity 并仅赋予它必要的属性以进行更新时,常常会错误地更新字段:

Plugins often update fields by mistake when they forget to instantiate a new Entity and give it only the necessary attributes to update:

实例化新实体

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 时,审核历史记录将仅显示一个字段为已更新.

smallEntity contains only one attribute. When Update is called, audit history will show only one field as having updated.

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

bigEntity contains every single entity attribute because it was retrieved using new ColumnSet(true). When Update is called, audit history will show all fields as having updated, even though only "firstname" has actually changed.

我如何使其停止?

how do I make it stop?

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

One option would be to filter the audit history view to only show the field you're interested in:

这篇关于Dynamics CRM 2013:审核日志中有“空白"记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆