Unable to save workflow configuration in Dynamics AX2012

By December 9, 2014Dynamics AX

While making changes to an existing workflow in Microsoft Dynamics AX2012, it can be very frustrating to click on the Save button,  to notice later that none of your work was saved.

Microsoft Dynamics AX2012 Workflow

Unable to save an existing workflow to which you are making small changes, is a known issue at Microsoft  the good thing is that it can be  fixed via a simple code change on the “canclose” method of the workflowEditorHost form.

If you go to the AOT > Forms > WorkflowEditorHost. Find the CanClose() method and change the code:
==============
From this:
==============
public boolean canClose()
{
boolean ret;

ret = super();

if (saveOnClose)
{
ret = modelEditorControl.SaveAndClose();
}

return ret;
}
===========================
To This
===========================
public boolean canClose()
{
boolean ret;

ret = super();

if (saveOnClose)
{
try
{
ret = modelEditorControl.SaveAndClose();
}
catch (Exception::Error)
{
info(“Caught ‘Exception::Error’.”);
}
catch (Exception::CLRError)
{
info(“Caught ‘Exception::CLRError’.”);
netExcepn = CLRInterop::getLastException();
info(netExcepn.ToString());
}

}

return ret;
}
=======================================

After making this change then do the following:

1. Run an Incremental CIL.
2. Compile Forward on the NumberSeq class (Right-click > Add-in > Compile Forward).
3. Generate an incremental CIL.

I hope this helps!