After upgrading CRM 2011, 2013 or 2015 to Dynamics 365, we can see a problem where the Default Business Process Flows that come with Dynamics 365 fail to Deactivate or Activate from the Processes area in CRM – instead reporting a stock error which is not much use in tracing to the root cause of the problem.

This is where the upgrade has left invalid records in the WorkflowBase Table that we can correct via a SQL Update.

NOTE: As with any Direct-to-SQL modification with Dynamics, this is best avoided if possible and should only be done following a full SQL Backup so we have a rollback point if anything goes wrong – but otherwise will fix this problem.

The SQL here is as follows:

SELECT * FROM WorkflowBase WHERE

       (Name = ‘Opportunity Sales Process’ OR Name = ‘Phone to Case Process’) AND

       [BusinessProcessType] is NULL

update dbo.WorkflowBase

set BusinessProcessType = 0

where

       (Name = ‘Opportunity Sales Process’ OR Name = ‘Phone to Case Process’) AND

       [BusinessProcessType] is NULL

This corrects the problem as the WorkflowBase records should have a ‘BusinessProcessType’ of 0 instead of NULL – where the [Name] is the Text Name of the Business Process Flow we need to fix. (this can also be done using the GUID for WorkflowId, but other the real-world name here is easier to work with)

This then allows the Dynamics UI to correctly interpret the record behind the Business Process Flow and so fixes the error on Activating or Deactivating.

All credit to the following article for providing the resolution to this error post-upgrade of Dynamics: https://community.dynamics.com/365/b/dynamics365blognl/archive/2017/03/03/error-deactivating-business-process-flow-after-upgrade-from-crm-2015-to-dyn365 

Error Log

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #7AA39F47Detail:
< OrganizationServiceFault xmlns:i=”https://www.w3.org/2001/XMLSchema-instance” xmlns=”https://schemas.microsoft.com/xrm/2011/Contracts”>
  < ActivityId>99bd6e08-f189-4f23-a8ad-43605b93f1fa</ActivityId>
  < ErrorCode>-2147220970</ErrorCode>
  < ErrorDetails xmlns:d2p1=”https://schemas.datacontract.org/2004/07/System.Collections.Generic” />
  <Message>System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #7AA39F47</Message>
  <Timestamp>2018-11-29T10:25:51.6466227Z</Timestamp>
  < ExceptionSource i:nil=”true” />
  < InnerFault>
    < ActivityId>99bd6e08-f189-4f23-a8ad-43605b93f1fa</ActivityId>
    < ErrorCode>-2147220970</ErrorCode>
    < ErrorDetails xmlns:d3p1=”https://schemas.datacontract.org/2004/07/System.Collections.Generic” />
    <Message>An unexpected error occurred.</Message>
    <Timestamp>2018-11-29T10:25:51.6466227Z</Timestamp>
    < ExceptionSource i:nil=”true” />
    < InnerFault i:nil=”true” />
    < OriginalException i:nil=”true” />
    < TraceText i:nil=”true” />
  </InnerFault>
  < OriginalException i:nil=”true” />
  < TraceText i:nil=”true” />
< /OrganizationServiceFault>

Author

Write A Comment