Running in debug mode
The basic concept behind debugging is the breakpoint, which is a mark that you can set on a statement. When the program flow hits the statement, the debugger is kicked in and suspends execution (technically, it breaks) until instructed to continue. Without any breakpoints, the code would run just fine as long as the debugger is active.The debugger will automatically stop the execution of the code only when it encounters an error, or if it has been instructed in the launch.json
file to break on record writes.A developer could also use the debugger to find potential logic errors since the debugger enables them to execute AL code syntax, one statement at a time, while inspecting the contents of variables at each runtime step. In this way, the developer can check and match what is expected when they have designed the application extension.You can run the debugger from Visual Studio Code in three ways:
- Click Debug | Start Debugging.
- Press the F5 shortcut key.
- Go to DEBUG...