AIF – How to get a better error message and stack trace for a failed document?

How many times when working with AIF you got an error and have no idea what caused the issue. The document fails for many reasons and what you get is a very generic error message. Debugging AIF is a painful process and time consuming. Below is the trick that we can find out more descriptive error message and even a stack trace.

image

image

Run the job below and replace the GUID with the GUID from the document that failed

static void TestOutboundMessage(Args _args)
{
    guid id = str2guid("{BCE9B13D-3F3C-497F-A566-55606C3F19B4}");
    
    AifQueueManager document;

    select firstOnly document where document.MessageId == id;

    // This static method is declared as private and this trick is to avoid changing the access specifier on the class
    new SysDictClass(classNum(AifOutboundProcessingService)).callStatic('processAsUser', [document.MessageId]);

}

Refresh and review the error again, you will see a more descriptive message and a stack trace that can save your life.

image

Dynamics AX – How to capture a Crash Dump

If your Microsoft Dynamics AX application ever crashes then you should know what troubleshooting steps to take to find out why this exception has occurred.

Please see the attached videos recorded by one of our Escalation Engineer’s from the Support team.

Video

  1. The first video includes information about; What is a crash?
  2. The second video includes information about; How to collect crash dumps.

 Dynamics AX – How to capture a Crash Dump.zip

Diagnostics Tool:

To capture a crash dump one of the tools used is debug diagnostics 1.2 please see the following link
http://www.microsoft.com/en-us/download/details.aspx?id=26798