【问题标题】:Business Process Flow disappear in Dynamics CRM 2015Dynamics CRM 2015 中的业务流程消失
【发布时间】:2016-01-14 05:05:00
【问题描述】:

我在案例实体中有 BPF(基于默认的“电话到案例流程”)。 当我通过 C# 代码解决或取消案例时 - BPF 从特定案例表单中消失,这会导致表单中的 JS 错误。 当我从 CRM 解决或取消案例时 - BPF 正常显示。

我的解决案例代码:

      Entity incidentResolution = new Entity("incidentresolution");
      incidentResolution.Attributes["incidentid"] = new EntityReference("incident", caseID);
      if (!string.IsNullOrEmpty(resolution))
      {
        incidentResolution.Attributes["subject"] = resolution;
      }
      if (!string.IsNullOrEmpty(description))
      {
        incidentResolution.Attributes["description"] = description;
      }

      CloseIncidentRequest closeIncidentRequest = new CloseIncidentRequest
      {
        IncidentResolution = incidentResolution,
        Status = new OptionSetValue(1000)
      };

      crmService.Execute(closeIncidentRequest);

这是我的取消案例代码:

      SetStateRequest setState = new SetStateRequest();
      setState.EntityMoniker = new EntityReference();
      setState.EntityMoniker.Id = caseID;
      setState.EntityMoniker.LogicalName = "incident";
      setState.State = new OptionSetValue(2);
      setState.Status = new OptionSetValue(2000);

      crmService.Execute(setState);

我可以为在这种情况下显示的 BPF 做些什么吗?

【问题讨论】:

    标签: c# dynamics-crm-2015


    【解决方案1】:

    业务流程 (BPF) 由两个字段针对 CRM 实体 进行管理 processidstageid。您必须找到合适的stage id 和 processid,它们会被 CRM 放置在案例记录中。

    从crm中找到stage id和processid解决或取消案例,并在数据库中查询这两个字段。

    所以在Cancelling/Resolving Case之前你必须更新case。

    Entity caseEntity = new Entity("incident");
    caseEntity.Id=caseID
    caseEntity["processid"]= new Guid("ABC") //the processid from DB
    caseEntity["stageid"]=new Guid("DEF") //the stageid from DB
    crmService.Update(caseEntity);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-01
      • 2023-03-10
      • 2017-09-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多