As part of my series on “Things new X++ Developers Should know”. I have been writing a few basic howtos for new X++ Developers.
Today’s post relates to quickly navigating to the source code from where an info log error, warning or information message is called from. It took me a while to figure out that for many info log messsages you can simply double click on the message in the info log window and the code that called the message will be displayed for you.
E.G. If you see the normal error log icon or warning icons with a small arrow in the bottom left corner, you are normally able to double click the message to see the code behind it. These icons look like this:
Simply Double click the message as below
To be presented with the code that called it.
NOTE 1: If you have your “Execute business operations in CIL” user option enabled, a lot of business logic like postings etc will not allow you to drill down.
NOTE 2: If the code calling the info message makes use of the SysInfoAction parameter, you will be taken to an alternate form specified by the developer and not the source code. (See Axaptapedia Article)
Problem / Symptom: When publishing a journal you receive a generic “Microsoft.Dynamics.Ax.Xpp.InfoException” was thrown error. Or you receive an error “Account number for transaction type Bank does not exist.”
Description: We received this error reported by the client when trying to post a general journal recently. They received the generic type of XPP error as shown above and were not able to diagnose the problem correctly
Solution: The first step to resolving this issue was to receive better error messages so that the problem can be diagnosed. By disabling the “Execute business operations in CIL” option for the user for the duration of debugging. To do this:
1. Navigate to System Administration -> Users -> Options -> Development.
2. Untick the “Execute business operations in CIL” option.
After performing the above we were able to get a better description of our problem. “Account number for transaction type Bank does not exist.”
We were then able to diagnose that the bank account used as the offset account did not have a “main account” number setup for it. This may have been due to faulty importing. To resolve:
1. Navigate to Bank -> Cash & Bank Management -> Bank Accounts
2. Select bank account in question, click edit
3. Expand currency management and select a main account.