How it works...

Debugging AL code is done via the Visual Studio Code integrated debugger. The AL Language extension makes it possible for the debugger to understand the AL language.

The debugger can be launched in a number of ways:

  • Breakpoints: The debugger will activate when the first line of code with a breakpoint is executed.
  • On error: The debugger will activate when an error is thrown in the code execution. This is enabled by setting "breakOnError": true in launch.json.
  • On record update: The debugger will activate when a record is updated. This is enabled by setting "breakOnRecordWrite": true in launch.json.

In Visual Studio Code, when your application has been published in debug mode, you'll notice there is a toolbar at the top of the window, like this:

This is your indicator that the debugger is running. It will be connected to the session that was launched in your web browser.

When you are debugging, you are able to perform the following actions:

  • Pause: Temporarily stop the debugger.
  • Step over: Bypass a function in debugging.
  • Step into: Enter into a function for debugging.
  • Step out: Finish executing the current function and return you to the calling function.
  • Restart: Launch a new debugging session without publishing the application.
  • Stop: Turn the debugger off. 
Code in a Business Central application can only be debugged if you set "showMyCode": true in the app.json file.

You can hide individual variables and functions from being debugged by using the [NonDebuggable] attribute, as follows:

[NonDebuggable]
local procedure MyExampleFunction()
begin

end;
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.105.137