Workflow: An unexpected error has occurred while opening the workflow. See the event log on the AOS and contact your system administrator to resolve the issue.

August 19, 2015 at 16:57
filed under Dynamics AX
Tagged , , , , , ,

When trying to view or edit a workflow, the following error can pop up:

An unexpected error has occurred while opening the workflow. See the event log on the AOS and contact your system administrator to resolve the issue.

This is a general error and it could mean a lot of things. Make sure you check the obvious things first:

Well… you know… do the usual.

In my case, none of this helped. Because this was a CLR exception, I modified the try/catch in the method that was throwing the error to show the inner exception. The method Forms\WorkflowEditorHost.run was modified so it looked like this:

public void run()
{
    System.Exception interopException;
   
    try
    {
        modelEditorControl.Load(workflowConfiguration, userSettings); // <- error thrown here
        [some more std code]
    }
    catch (Exception::CLRError)
    {
        interopException = CLRInterop::getLastException();
        while (!CLRInterop::isNull(interopException.get_InnerException()))
        {
            interopException = interopException.get_InnerException();
        }

        error(strFmt("%1", CLRInterop::getAnyTypeForObject(interopException.get_Message())));
        throw error("@SYS327400");
    }

    super();
}

After trying to open the workflow again, this was the inner exception:

Kan een object van het type System.Windows.Input.CommandBinding niet converteren naar het type System.Activities.Presentation.View.DesignerView.

Translated:

Cannot convert an object of type System.Windows.Input.CommandBinding to the type System.Activities.Presentation.View.DesignerView.

The fact that the error was in Dutch gave me a clue. Turn out a language pack for .NET framework 4 was installed on the machine. However, recently the .NET framework 4.5.2 was also installed on that machine. After installing the Language Pack for Microsoft .NET Framework 4.5 (link) and rebooting the machine, the error was solved.

no comments

RSS / trackback

respond