Debugging trick number one: Info.Add()

April 14, 2009 at 21:00
filed under Dynamics AX
Tagged ,

Now and then, someone comes up to you and says “Could you take a look? There’s an error on my screen”. Mostly, it’s an infolog. And most of the time, you can double click on the message, AX will open the code editor and place the cursor on the line where the message originated. Then, it is either very clear why the message is shown, or you can place a breakpoint to debug the problem.

But sometimes, when you double click on the message, a help window will pop up in stead of the code editor. For example when an error is thrown by the kernel. This can make it difficult to find out where exactly the problem occurs.

Luckily, for every messages that is added to the infolog, the code in the class Info, method Add() is executed. When you put a breakpoint in Info.Add(), the debugger will pop up when a message is added to the infolog, even if they originate in the kernel.

In my opinion, this is the most handy “debugging trick” in AX.

1 comment

RSS / trackback

  1. Martin Hägg

    Yeah that’s a great work process but what about AX2012? There the info.add is called in a runas method?

    Any thoughts?

respond