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. quartz(1)

    关于定时任务的操作方法,java语言本身具有 Timer 来解决,但Timer 作用起来不是特别的舒服,由于项目的需要,使用了Quartz 这个调度框架,现把学习过程记录下来,方便以后查阅. 本教程是 ...

  2. Eclipse中的Link with Editor功能是如何实现

    Eclipse中的Link with Editor功能是如何实现 - kaukiyou的专栏 - 博客频道 - CSDN.NEThttp://blog.csdn.net/kaukiyou/articl ...

  3. pyside窗口关闭触发事件

    窗口关闭事件本质上是重写了类内部的closeEvent方法,可以通过重写这个类去实现其他你想要的关闭事件. 下面的例子实现了一个简单的窗口,并为窗口添加了关闭时弹出提示框的功能. import sys ...

  4. MSXML使用教程

    在DOM接口规范中,有四个基本的接口:Document,Node,NodeList以及NamedNodeMap.在这四个基本接口中,Document接口是对文档进行操作的入口,它是从Node接口继承过 ...

  5. openacs与easycwmp的对接

    原创作品,转载请注明出处 copyright:weishusheng   2015.3.18 email:642613208@qq.com 平台: Linux version 2.6.32-279.e ...

  6. MyBatis学习(二)

    前言 昨天的博客简单的记录了MyBatis的起源.作用.配置以及一个简单的查询例子.写到一半的时候,觉得已经学会了MyBatis,可是全写完的时候才发现,如果多个参数查询,如何表的名字与类字段名不一样 ...

  7. C语言实现简单php自定义扩展

    1.下载php源码 下载地址:http://cn2.php.net/get/php-5.6.29.tar.gz/from/this/mirror 传到/usr/local/src/下 上传命令:rz ...

  8. 网络请求三方库——OkHttp

    我们知道在Android开发中是可以直接使用现成的API进行网络请求的,就是使用 HttpClient 和 HttpURLConnention ,而Android 4.4 之后 HttpClient  ...

  9. 解决iis7 0x80070002 错误代码问题

    环境:iis7 win7 64位 vs2012 出现的问题:发布代码iis出现0x80070002 错误代码 解决方案分三步: 1.添加通配符脚本映射 请选择:C:\Windows\Microsoft ...

  10. setTimeout()与setInterval()

    一.setTimeout与setInterval的用法(http://www.css88.com/archives/5804) setTimeout是超时调用,javascript是一个单线程的解析器 ...