AX7: Quick and easy debugging

This purpose of this blog is to show how you can get quickly get started with debuggingin AX7, specifically by showing how you can debug an error message issued from AX.

So, let’s begin !

Imagine you are posting a Bank journal and you get the following error message upon posting ‘Currency EUR not allowed for account USMF OPER’

You would like to know the logic behind this error message, but need to trace in the code where it was issued from

We will use a classic debugging technique known from AX 2012 to demonstrate how this can be done quickly and easily, by inserting a breakpoint on the Info class to enable the debugger to track down in the code where the error is generated from.

These are the steps 1.Start Visual Studio as ‘Administrator’

2.  Go to the Application explorer, go to the ‘Code’ node, select ‘Classes’ and locate the ‘Info’ class

On the ‘Info’ class rightclick and select ‘View code’

In the window that opens up, select the ‘Add’ method

3. Insert your breakpoint on the ‘Add’ method by pressing ‘F9’

4. Press ‘Debug’ from the toolbar and select ‘Attach to process’

In the ‘Attach to process’ screen mark ‘Show processes from all users’ and then browse to  the process ‘w3wp.exe’

Wait for the Symbols to load

5. Once the symbols have loaded repeat the application procedure, eg. in this case we will post the journal again to generate the error message

And note that almost immediately the debugger starts executing in Visual Studio

I copy the call stack into Notepad and here I note especially the highlighted line as this is the line that is triggered just before the call to the Infolog code

I can see that the error is triggered on the BankAccountTable, checkCurrency method on line 225 and I stop debugging

I go to this code to study the method

I open up the BankAccountTable and similar to as on the ‘Info’ class I select ‘’ and open the method I am interested in

Here naturally ‘checkCurrency’

And  we can study the code that generated the error message

Naturally, you can use the same technique to insert breakpoints in other places of the code such as on ‘init’, ‘update’ and ‘insert’ methods etc

Happy debugging !

时间: 2024-10-06 19:19:56

AX7: Quick and easy debugging的相关文章

Quick and Easy Installation of Oracle Database 12c on Oracle Linux in Oracle VM VirtualBox

发贴人 Sergio-Oracle 于2018-4-18 23:10:15在Oracle Linux Introduction How Does This Work? Requirements Before You Get Started Steps Clone the vagrant-boxes repository from GitHub Download Oracle Database Installation Files Place the downloaded Database ins

网上搜集第三方(二)

這是我收集了一些第三方的 Library,大部份都還沒用過Orz,只是這樣整理以後要用到的時候會比較好找到. UI UI Design alertView Menu(選單) Side ViewController UICollectionView Segment Control Others 動畫 影像特效 模糊.毛玻璃效果(Blur) 畫面轉換 各種統計圖表 Line Bar Pie Others Pull To ReFresh Notification Auto Layout Data St

很好的iOS学习资料

https://github.com/vsouza/awesome-ios 汇集了很多好的资料 https://github.com/vsouza/awesome-ios Skip to content This repository Pull requests Issues Gist You don’t have any verified emails. We recommend verifying at least one email. Email verification helps ou

github上所有大于800 star OC框架

https://github.com/XCGit/awesome-objc-frameworks#awesome-objc-frameworks awesome-objc-frameworks ID Framework Images 1 AFNetworking/AFNetworking 19,058 A delightful iOS and OS X networking framework 2 rs/SDWebImage 10,139 Asynchronous image downloade

RFID 克隆/仿真/模拟/监控/拦截/检测/嗅探器

Demo: Cloning a Verichip Yourself Download I have: schematics as PDF BOM, with Digikey part numbers board artwork (Gerbers and drill file) PIC source code (assembly for MPASM / IHEX binary) Theory of Operation Please refer to the schematic. It's impo

Tracing java execution (copy from http://zvikico.typepad.com/problog/2007/11/five-ways-for-t.html)

Five ways for tracing Java execution I'm often faced with a situation where I need to dig into code that I didn't write. Most of it is poorly documented and, in some cases, I only have some of the sources, which means I need to decompile the rest. It

[it-ebooks]电子书列表

#### it-ebooks电子书质量不错,但搜索功能不是很好 #### 格式说明  [ ]中为年份      ||  前后是标题和副标题  #### [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Objective-C to develop iPhone games http://it-ebooks.info/book/3544/ Learning Web App Developmen

C++开源库集合

| Main | Site Index | Download | mimetic A free/GPL C++ MIME Library mimetic is a free/GPL Email library (MIME) written in C++ designed to be easy to use and integrate but yet fast and efficient. It is based on the C++ standard library and heavily us

Learning WCF Chapter1 Generating a Service and Client Proxy

In the previous lab,you created a service and client from scratch without leveraging the tools available to WCF developers. Although this helps you to understand the raw requirements for sending messages between clients and services,in reality,develo