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 !

AX7: Quick and easy debugging的更多相关文章

  1. 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 Bef ...

  2. Awesome Go精选的Go框架,库和软件的精选清单.A curated list of awesome Go frameworks, libraries and software

    Awesome Go      financial support to Awesome Go A curated list of awesome Go frameworks, libraries a ...

  3. Dom4j quick start guide

    Parsing XML Using Iterators Powerful Navigation with XPath Fast Looping Creating a new XML document ...

  4. (转) [it-ebooks]电子书列表

    [it-ebooks]电子书列表   [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Obj ...

  5. SubSonic指南中文版

    翻译:王鹏程张原 王伟策划:毛凌志2009年1月北京工业大学软件学院PS:有问题反馈至http://lexus.cnblogs.comGetting Started with SubSonicBy S ...

  6. RFID 仿真/模拟/监控/拦截/检测/嗅探器

    Sound card based RFID sniffer/emulator (Too tired after recon.cx to do draw the schematics better th ...

  7. github上所有大于800 star OC框架

    https://github.com/XCGit/awesome-objc-frameworks#awesome-objc-frameworks awesome-objc-frameworks ID ...

  8. 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 avail ...

  9. Frontend Development

    原文链接: https://github.com/dypsilon/frontend-dev-bookmarks Frontend Development Looking for something ...

随机推荐

  1. mysql数据库性能篇

    慢查询:超过设定时间的SQL语句会被记录到指定文件内 1.观察mysql慢查询默认的时间(默认10秒) show variables like 'long%'; 2.修改慢查询设定时间 set lon ...

  2. CocoaPods报错:The dependency `Alamofire ` is not used in any concrete target

    看到这个错误提示,首先看看自己的版本是不是 OS X EI Capitan,也就是10.10以后的版本,因为这个版本是比较新的版本,网络上找的那些安装cocoapod命令其实有些过时了,特别是创建po ...

  3. PSP第九周

    一.表格 C(分类) C(内容) S(开始时间) ST(结束时间) I(打断时间) △(净工作时间) 学习 UML 12:30 13:20 0 50 编码 编码 20:00 22:10 0 130 学 ...

  4. JS的字符串处理

    1.字符串包含判断 var a = "qwer"; var b = "q"; if (a.contains(b)) { alert("1") ...

  5. 【转载】ANSYS完全法与模态叠加法瞬态分析实例

    原文地址:http://www.caetecc.com/thread-2172-1-1.html ! 半脉冲载荷 --- 模态叠加法fini/clear,nostart/PREP7ET,1,BEAM4 ...

  6. 前端学习 第七弹: Javascript实现图片的延迟加载

    前端学习 第七弹: Javascript实现图片的延迟加载 为了实现图片进入视野范围才开始加载首先: <img    src="" x-src="/acsascas ...

  7. 推荐一个Jenkins 插件 Build Failure Analyzer

    Wiki https://wiki.jenkins-ci.org/display/JENKINS/Build+Failure+Analyzer 作用: 按照预定的build failure 去解析co ...

  8. 全面解析sizeof(上) 分类: C/C++ StudyNotes 2015-06-15 10:18 188人阅读 评论(0) 收藏

    以下代码使用平台是Windows7 64bits+VS2012. sizeof是C/C++中的一个操作符(operator),其作用就是返回一个对象或者类型所占的内存字节数,使用频繁,有必须对齐有个全 ...

  9. Spring源码学习之: 通过Spring @PostConstruct 和 @PreDestroy 方法 实现初始化和销毁bean之前进行的操作

    关于在spring  容器初始化 bean 和销毁前所做的操作定义方式有三种: 第一种:通过@PostConstruct 和 @PreDestroy 方法 实现初始化和销毁bean之前进行的操作 第二 ...

  10. WPF 打印

    1. System.Windows.Controls.PrintDialog printDialog = new System.Windows.Controls.PrintDialog(); if ( ...