Skip to main content
Community site session details

Community site session details

Session Id :

Adding a breakpoint through code in Dynamics Ax

Community Member Profile Picture Community Member

Every time I see a warning or error, the default place where i place my debugger was at “\Class\Info\add”. I was really not happy of going each time to the same class to place a breakpoint. This week i got rid of it finally :)

What I did was develop a small piece of code that will automatically add a breakpoint and called this piece of code from the internal development toolbar that we have. The internal development toolbar is something like Tabax.  You can also do the same and integrate with your own toolbar/ Tabax / Ax Assist.

static void addBreakPoint(Args _args)
{
    container bpCon;
    int       vers, i;
    ;
    //Get the breakpoint
    bpcon = infolog.breakpoint();

   //Version just for reference not really needed
    vers = conpeek(bpCon, i); i++;

    //set the breakpoint
    bpCon += [@"\Classes\Info\add"];
    bpCon += [1];
    bpCon += [true];

    infolog.breakpoint(bpCon);
}

Refer to the article below if you want to know or create toolbar for Ax.
http://kamalblogs.wordpress.com/2007/03/28/a-simple-toolbar-for-dynamics-ax-4-0/


This was originally posted here.

Comments

*This post is locked for comments