{"id":229,"date":"2022-01-07T13:02:30","date_gmt":"2022-01-07T13:02:30","guid":{"rendered":"https:\/\/blog.citrus-lime.com\/crmc\/?p=229"},"modified":"2022-01-07T13:02:31","modified_gmt":"2022-01-07T13:02:31","slug":"error-deactivating-or-activating-business-process-flow-after-upgrade-of-dynamics-crm","status":"publish","type":"post","link":"https:\/\/blog.citrus-lime.com\/crmc\/error-deactivating-or-activating-business-process-flow-after-upgrade-of-dynamics-crm\/","title":{"rendered":"Error Deactivating or Activating Business Process Flow after Upgrade of Dynamics CRM"},"content":{"rendered":"\n<p>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 \u2013 instead reporting a stock error which is not much use in tracing to the root cause of the problem.<\/p>\n\n\n\n<p>This is where the upgrade has left invalid records in the WorkflowBase Table that we can correct via a SQL Update.<\/p>\n\n\n\n<p><strong>NOTE:&nbsp;<\/strong>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 \u2013 but otherwise will fix this problem.<\/p>\n\n\n\n<p>The SQL here is as follows:<\/p>\n\n\n\n<p>SELECT&nbsp;*&nbsp;FROM&nbsp;WorkflowBase&nbsp;WHERE<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Name&nbsp;=&nbsp;&#8216;Opportunity Sales Process&#8217;&nbsp;OR&nbsp;Name&nbsp;=&nbsp;&#8216;Phone to Case Process&#8217;)&nbsp;AND<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[BusinessProcessType]&nbsp;is&nbsp;NULL<\/p>\n\n\n\n<p>update&nbsp;dbo.WorkflowBase<\/p>\n\n\n\n<p>set&nbsp;BusinessProcessType&nbsp;=&nbsp;0<\/p>\n\n\n\n<p>where<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Name&nbsp;=&nbsp;&#8216;Opportunity Sales Process&#8217;&nbsp;OR&nbsp;Name&nbsp;=&nbsp;&#8216;Phone to Case Process&#8217;)&nbsp;AND<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[BusinessProcessType]&nbsp;is&nbsp;NULL<\/p>\n\n\n\n<p>This corrects the problem as the WorkflowBase records should have a \u2018BusinessProcessType\u2019 of 0 instead of NULL \u2013 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)<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>All credit to the following article for providing the resolution to this error post-upgrade of Dynamics:&nbsp;<a href=\"https:\/\/community.dynamics.com\/365\/b\/dynamics365blognl\/archive\/2017\/03\/03\/error-deactivating-business-process-flow-after-upgrade-from-crm-2015-to-dyn365\">https:\/\/community.dynamics.com\/365\/b\/dynamics365blognl\/archive\/2017\/03\/03\/error-deactivating-business-process-flow-after-upgrade-from-crm-2015-to-dyn365<\/a>&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Error Log<\/h3>\n\n\n\n<p>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:<br>&lt; OrganizationServiceFault xmlns:i=&#8221;<a href=\"https:\/\/www.w3.org\/2001\/XMLSchema-instance%22\">https:\/\/www.w3.org\/2001\/XMLSchema-instance&#8221;<\/a>&nbsp;xmlns=&#8221;<a href=\"https:\/\/schemas.microsoft.com\/xrm\/2011\/Contracts%22\">https:\/\/schemas.microsoft.com\/xrm\/2011\/Contracts&#8221;<\/a>&gt;<br>&nbsp; &lt; ActivityId&gt;99bd6e08-f189-4f23-a8ad-43605b93f1fa&lt;\/ActivityId&gt;<br>&nbsp; &lt; ErrorCode&gt;-2147220970&lt;\/ErrorCode&gt;<br>&nbsp; &lt; ErrorDetails xmlns:d2p1=&#8221;<a href=\"https:\/\/schemas.datacontract.org\/2004\/07\/System.Collections.Generic%22\">https:\/\/schemas.datacontract.org\/2004\/07\/System.Collections.Generic&#8221;<\/a>&nbsp;\/&gt;<br>&nbsp; &lt;Message&gt;System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #7AA39F47&lt;\/Message&gt;<br>&nbsp; &lt;Timestamp&gt;2018-11-29T10:25:51.6466227Z&lt;\/Timestamp&gt;<br>&nbsp; &lt; ExceptionSource i:nil=&#8221;true&#8221; \/&gt;<br>&nbsp; &lt; InnerFault&gt;<br>&nbsp;&nbsp;&nbsp; &lt; ActivityId&gt;99bd6e08-f189-4f23-a8ad-43605b93f1fa&lt;\/ActivityId&gt;<br>&nbsp;&nbsp;&nbsp; &lt; ErrorCode&gt;-2147220970&lt;\/ErrorCode&gt;<br>&nbsp;&nbsp;&nbsp; &lt; ErrorDetails xmlns:d3p1=&#8221;<a href=\"https:\/\/schemas.datacontract.org\/2004\/07\/System.Collections.Generic%22\">https:\/\/schemas.datacontract.org\/2004\/07\/System.Collections.Generic&#8221;<\/a>&nbsp;\/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;Message&gt;An unexpected error occurred.&lt;\/Message&gt;<br>&nbsp;&nbsp;&nbsp; &lt;Timestamp&gt;2018-11-29T10:25:51.6466227Z&lt;\/Timestamp&gt;<br>&nbsp;&nbsp;&nbsp; &lt; ExceptionSource i:nil=&#8221;true&#8221; \/&gt;<br>&nbsp;&nbsp;&nbsp; &lt; InnerFault i:nil=&#8221;true&#8221; \/&gt;<br>&nbsp;&nbsp;&nbsp; &lt; OriginalException i:nil=&#8221;true&#8221; \/&gt;<br>&nbsp;&nbsp;&nbsp; &lt; TraceText i:nil=&#8221;true&#8221; \/&gt;<br>&nbsp; &lt;\/InnerFault&gt;<br>&nbsp; &lt; OriginalException i:nil=&#8221;true&#8221; \/&gt;<br>&nbsp; &lt; TraceText i:nil=&#8221;true&#8221; \/&gt;<br>&lt; \/OrganizationServiceFault&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 \u2013 instead reporting a stock error which is not much use in tracing to the root cause of<\/p>\n","protected":false},"author":43,"featured_media":35,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_tribe_ticket_capacity":"0","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"footnotes":""},"categories":[3],"tags":[],"class_list":{"0":"post-229","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-crm"},"featured_image_src":"https:\/\/blog.citrus-lime.com\/crmc\/wp-content\/uploads\/sites\/30\/2021\/11\/Dynamics-365-Consultancy.jpg","author_info":{"display_name":"jadesmith","author_link":"https:\/\/blog.citrus-lime.com\/crmc\/author\/jadesmith\/"},"_links":{"self":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts\/229","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/users\/43"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/comments?post=229"}],"version-history":[{"count":1,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts\/229\/revisions"}],"predecessor-version":[{"id":230,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts\/229\/revisions\/230"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/media\/35"}],"wp:attachment":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/media?parent=229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/categories?post=229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/tags?post=229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}