Unable to Save Workflow Configuration in Dynamics AX2012

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

Being unable to save an existing workflow to which you are making small changes, is a known issue at Microsoft, however 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!

Snezana Kokot is a Senior AX Consultant at InterDyn AKA.

Was this a helpful tip? Let us know!

By | 2017-10-13T20:09:02+00:00 December 7th, 2012|Tech Tips|0 Comments
Alternative Text

Contributor: AKA Enterprise Solutions

AKA is comprised of professionals with deep experience in business, technology, and their respective industries. Our team members regularly share their knowledge and expertise through blog articles. We hope you find them helpful, and we welcome your comments.

Leave A Comment