Not able to delete the system workflow step in MS CRM 2016 on-premise

a 夏天 提交于 2021-01-28 05:05:52

问题


I have created a system workflow and deleted the workflow itself long back. But still the workflow is running. I cannot find it under normal process. But when I do the advanced find for process entity, I can find the workflow. When I am open it there is not delete or deactivate button for it.

I tried deleting or deactivating it from the workflow view itself. But it is not allowing me do. Getting the generic error as "Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support" . Could you please help on this. As this work has few email sending steps, so triggering the emails which I want to stop.

I cannot find it under the setting, all process.

But I can find it when I look for the process, use the “New” view and delete all the predefined conditions. In the below screen I click on the result able to find the workflow.

Workflow image


回答1:


There are two types are Workflow records - Definition & Activation (I'm ignoring Template in this scenario)

For every workflow, two entries will be there. You can use my query to check in DB.

One will have option to Deactivate and the other one don't have.

You are seeing the Activation snapshot record used for execution of WF for lifetime. Take care of those which are already triggered.

If you look at the schema for the Type attribute, there are three values:

1 = Definition
Definition of a Workflow that is displayed in the application in the "All Processes" view. When you make changes to a workflow, you are making a change to a Workflow definition (or template); if you delete a workflow, you are deleting a workflow definition (or template)

2 = Activation
Whenever you activate (or publish) a workflow, an Activation record is created. An activation represents a snapshot of the workflow definition taken at activation time. If a Workflow is triggered, the System Job (asyncoperation) links back to the Workflow Activation record. Imagine you activate a workflow, a workflow is triggered and is in the midst of running, when you deactivate the workflow and make a change. In order to not effect the currently running Workflow, it uses the Workflow Activation record. If the workflow is triggered again, it will use the new definition (or workflow activation).

3 = Template
If you mark a Workflow as a Workflow Template, it will show up on the new Workflow dialog. If you choose to use a template, a copy of the template will be used as a basis of the Workflow.

When a Workflow is deleted from the system, the definition is deleted. However, if the workflow was ever published the Activation will remain for a period of time. Once all of the System Jobs that reference a particular Workflow Activation have completed and have been cleaned up (occurs through a recurring daily bulk delete job), the Workflow Activation will also be deleted.

Reference




回答2:


As specified in the below blog was not able to delete those activation type workflows from UI. https://sachinbansal.blog/2018/05/02/error-while-deactivating-workflows-should-be-exactly-1-messageprocessingstep-registered-for-workflow-dynamics-365/

We have on-premise CRM, so deleted the workflow from CRM database. It is working fine now. Before deleting the workflow took full database backup. Run the select query by proving the workflow GUID. After finding the matching workflow record, deleted them from database. In my case I have found the matching records from the below list of tables in the database.

  1. WorkflowDependencyBase
  2. WorkflowBase
  3. WorkflowBaseIds


来源:https://stackoverflow.com/questions/59767352/not-able-to-delete-the-system-workflow-step-in-ms-crm-2016-on-premise

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!