【发布时间】:2021-03-07 21:55:11
【问题描述】:
我正在编写一个更改所有者的 Post 插件。当所有者有替代经理时,所有者将更改为替代经理。我尝试了 service.Update 和 AssignRequest,但这些都抛出了异常。
当我发布请求时,我的实体无法更新(然后抛出“请求通道在 10:00:00 之后等待回复时超时”)。但是就像我看到的那样没有递归,因为当我记录它时,我只有一次重复的日志,并且它在更新之前或在线更新时停止了。
var assignedIncident = new AssignRequest
{
Assignee = substManagerRef, //get it throw another method, alreay checked in test it`s correct
Target = new EntityReference ("incident", incedentId)
};
service.Execute(assignedIncident);
我尝试用另一种方式编写目标
Target = postEntityImage.ToEntityReference()
我尝试编写简单的更新,但问题是一样的。
Entity incident = new Entity("incident" , incidentId);
incident["ownerid"] = substManagerRef:
service.Update(incident);
有人可以帮我吗?或者可能会显示解决它的方法)
【问题讨论】:
-
您确定您的更新后插件步骤的过滤属性中没有 ownerid 吗?
-
我检查了 postentityImage.contains.Attribute("ownerid") 是否等于 true。
-
图像是前/后值的快照。过滤属性和目标存储当前事务值。如果您在过滤属性中有 ownerid 并且当您继续更新 ownerid 字段时 - 插件会在循环中触发。检查插件执行深度是否安全。
-
我已经做过了,用1-2-3-4-5-6这样的行登录,但是7在更新之后就停止了。
-
你把这个插件改成异步的时候有同样的错误吗?
标签: dynamics-crm microsoft-dynamics