Wednesday 5 September 2018

Debug your code in D365FO Part-1

This post will be about how to debug your code in D365FO. As we all know that Visual studio will be used for coding in D365. So here no more requirement of Dynamics AX Debugger instead of this we will be using debugger of  Visual Studio.

There are two ways through which you can debug X++  code in Microsoft Visual Studio.
  • Debug X++ code by setting as Startup object
  • Debug X++ code by attaching it with the process
In part-1 I will be discussing about the first technique in which debugging will be performed by setting as Startup object.
To debug  X++ code with startup object technique , following are the steps.

Step1 ) Open the X++ code in Visual Studio to debug

Step 2) Find the line or lines where you want to debug and set a breakpoints on those lines. In order to set a break point go to the line and press F9 or left click and go to breakpoint and select insert a break point. You will see a red dot which indicates that break point has been added.











Step 3) Now right click on project and go to its properties and set your class as Startup object.











Step 4) On debug menu , select start debugging


















Step 5) Wait, till symbols are loaded and your debugging will be started.

Note: If your breakpoint does not hit then you might need to rebuild model and restart visual studio.



















2 comments:

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