Microsoft Dynamics CRM workflow usage

Asked By 0 points N/A Posted on -
qa-featured

We desire to remove numerous characteristics from an object we fashioned (Employee).  Typically, this is an incredibly direct issue with Microsoft Dynamics CRM.  You merely eliminate the area from the Form and Grids. From there, utilizing the Entity Editor, you then pick the characteristic and click “delete”.  In our incident, the characteristics in discussion were being utilized by workflow.  Regrettably, the error report you get from CRM is not very useful. Can you tell me how to stop their use in workflow and remove them?

Thank you very much for your service.

Error:

Microsoft Dynamics CRM — Webpage Dialog

This Attribute cannot be deleted because it is used in one or more workflows. Cancel any system jobs for workflows that use this attribute, then delete or modify any workflows that use the attribute, and then try to delete the attribute again.

SHARE
Answered By 0 points N/A #153403

Microsoft Dynamics CRM workflow usage

qa-featured

Hello Asteneves,

With a little bit of SQL knowledge, this might solve your problem.  Here’s what you can try.

               ***Run this query against your MSCRM Database:***

DECLARE @CharacteristicsYouAreTryingToModify VARCHAR(50)
DECLARE @CharacteristicsYouAreTryingToDelete VARCHAR(50)

***Update these to the entity and attribute you are working with***

 
SET @CharacteristicsYouAreTryingToModify = 'invoke_employees'
SET @CharacteristicsYouAreTryingToDelete = 'invoke_hardwaremacintoshdesktop'

SELECT    WFD.WorkflowDependencyId AS 'workflowdependencyid',
    WF.Name FROM WorkflowDependency AS WFD

 

***Join out to the Workflow Table to get the Name of the Workflow***

    JOIN Workflow AS WF ON
    WFD.WorkflowId = WF.WorkflowId AND
    WF.StateCode = 1

    WHERE
    WFD.DeletionStateCode = 0 AND
    WFD.DependentEntityName = @CharacteristicsYouAreTryingToModify AND
    WFD.DependentAttributeName = @CharacteristicsYouAreTryingToDelete AND
    WFD.Type = 8 AND
    WF.DeletionStateCode = 0

When you run this query, it will give you a list of workflows that are running that contain the characteristics you want to delete.

Once you have the list, you can now:

  •  Unpublish the workflow
  •  Remove the dependency (In the “Properties” of a Step, the “Record Attributes Change” list, etc)
  •  Publish your workflow again
  •  Delete the characteristics/attributes

Now, if you happen to instead:

  • Unpublish the Workflow(s)
  • Delete the Attribute
  • And try to re-publish the Workflow(s)

You will get this error message:

This is because, as a safety measure the CRM delete attribute process only deletes part of it and not all. If this happens to you, just open the Workflow editor using the User Interface, remove the dependency and “re-save” it.

The workflow UI and other XMLs will get updated with the new changes. You should be able to publish your workflow again without problems.

Related Questions