【问题标题】:"Business Process Error" when trying to create an entity尝试创建实体时出现“业务流程错误”
【发布时间】:2017-05-13 06:54:36
【问题描述】:

插件前操作代码中的代码如下所示:

var cloneEntity = new Entity(SPLIT_SAVINGS);
object endDate;
_parentEntity.Attributes.TryGetValue(END_DATE, out endDate);

cloneEntity.Attributes[START_DATE] = _parentEntity.Attributes[START_DATE];
cloneEntity.Attributes[END_DATE] = endDate;
cloneEntity.Attributes[RATIO] = _parentEntity.Attributes[RATIO];
Guid cloneId = service.Create(cloneEntity);

所以我要做的是,在创建此实体的预操作期间,它还将克隆自身(相同的日期和比率属性)以与另一个相关实体相关联。我不确定如何处理错误日志。我唯一能做的就是错误代码,我什么也找不到。

这是否与 Create() 调用再次递归执行 pre-op 的事实有关?我已经有了防止无限循环的条件逻辑。

这是错误日志以供参考。谢谢。

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: There was an error in the Plugin CRMPluginSolution.Plugins.SplitSavingsRatioProcess, and a log has been created.  Please try this again later. If this issue persists contact your IT Staff. Detail: 
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
  <ErrorCode>-2147220891</ErrorCode>
  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
    <KeyValuePairOfstringanyType>
      <d2p1:key>OperationStatus</d2p1:key>
      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">0</d2p1:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <d2p1:key>SubErrorCode</d2p1:key>
      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">-2146233088</d2p1:value>
    </KeyValuePairOfstringanyType>
  </ErrorDetails>
  <Message>There was an error in the Plugin CRMPluginSolution.Plugins.SplitSavingsRatioProcess, and a log has been created.  Please try this again later. If this issue persists contact your IT Staff. </Message>
  <Timestamp>2016-12-28T23:42:10.5503562Z</Timestamp>
  <InnerFault i:nil="true" />
  <TraceText>

[CRMPluginSolution.Plugins: CRMPluginSolution.Plugins.SplitSavingsRatioProcess]
[77dfca7a-35cd-e611-80df-00059a3c7a00: SplitSavingsRatioProcess]


</TraceText>
</OrganizationServiceFault>

【问题讨论】:

    标签: c# crm dynamics-crm-2016


    【解决方案1】:

    发现问题。我的插件注册工具的分析器被设置为在 Create 调用上抛出一个异常,所以它永远不会超过那个。一旦我将分析器设置为使用持久性,就会创建实体。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-09-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多