Thursday 4 October 2018

Debug X++ code of workflow in AX 2012

Today I will discussing about how to debug X++ code of  workflow in AX 2012. As we all know that workflow submission code is native X++ and its event handler code is compiled into CIL.
Here is the method through which we can debug its code for instance submit manager or event handlers code etc.

Note : Before starting the process of debugging you have to make sure that debugging is enabled for the server.  For this purpose open Microsoft Dynamics AX Server Configuration utility as administrator then create or check existing configuration. On Application object server tab you need to mark Enable breakpoints to debug code running on this server check box.

For development work space - Set breakpoints in the X++ code by using Code Editor.

Step 1) Start Visual Studio as administrator.

Step 2) Go to view menu and click on Application explorer. It will open the AOT artifacts.















Step 3) In the classes node of Application explorer, go to your classes and expand it. You will see different methods of that code. Now double click on method that you want to debug or right click on method and select view code option it will open your code in designer.
















Step 4) Insert a break point on the line of code you want to debug. For this press F9 or right click on the line then go to break point and select insert break point option.

Step 5) Go to Debug menu and click on Attach to process option.












Step 6) Select AX32Serv.exe option from the Attach process screen and click on Attach button. Make sure show processes for all users option is checked.
















Step 7) Symbols will be loaded and break point will be be enabled. When you will start submission  of  your workflow it will hit on the line code to whom you have set for debugging.













No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Custom Business events Part 3 - (Activate custom business event) in D365 F&O

 In this blog we will discuss about the steps to activate a custom business in D365 F&O. As we know that business event catalog does not...