Friday, April 2, 2010

Breakpoint in clicked method

There is quite well known bug in AX that breakpoint placed in the clicked() method of a button will not be triggered. It is quite unpleasant one since when one faces it first time he gets totally confused.
However, there are easy workarounds for this bug. First one – put breakpoint into the method that is called from clicked (in most cases it is possible). But if not, keyword breakpoint can be used – it will be triggered in clicked() method.

7 comments:

  1. How do you do a keyword breakpoint? Completely missed them.

    ReplyDelete
  2. Just write "breakpoint;" in code.

    ReplyDelete
  3. you can also refer here for a similar suggestion on using "breakpoint"

    http://kamalblogs.wordpress.com/2010/04/15/debugging-form-controls-in-dynamics-ax/

    ReplyDelete
  4. I always thought soft breakpoints will not work in forms since forms are user-driven, which is why hard breakpoints are required when debugging.

    It does make it a nightmare, especially when you have to check it into source control and then elevate the changes to a test environment in order to properly debug form level logic.

    ReplyDelete