Sunday, October 02, 2016

NAV Debugger Keyboard Shortcuts - Tips, Tricks & Facts #2

Hi Guys. I want share knowledge about something which could save a considerable amount of time while debugging.

Developers like us debug code almost every day. So knowing the shortcuts will save us so much time!

Most of us must be knowing these shortcut keys but for those who don't, checkout this post. I hope it helps you out and debugging takes lesser time.

Lets start with Activating debugger first,

1. Activate Debugger - When you are in the development environment, Press Alt then T then U and Session List window will open up like the one shown below,

Now, go to your session's row.

2. Start Debugger - To start debugger Press Ctrl + Shift + S after selecting your session from session list. Debugger will appear as shown below,

3. Add Watch - For a demo of adding watch on a variable, I am applying breakpoint on "Sell-to Customer No." OnValidate trigger of Sales Header. When I enter a value in "Sell-to Customer No." debugger breaks as shown below,

Instead of going to Variables, Take your pointer to the variable for which you want to add watch, In this demo, I hovered my mouse pointer over the area marked in Orange box in . Tooltip opens up below this variable, Click on the sign which is marked in red circle, this sign is a spectacles with a plus sign above it. This sign is also shown below, shown but barely visible. Quite small! :D

So instead of opening all the variables, this is an easier and faster way to apply watch.

The next shortcuts help us working with the debugger.

4. F11 (Step Into) - Step Into will let you traverse though all the code.

5. F10 (Step Over) - Step Over will also traverse through all the code but will not enter any functions/triggers/events which come in its way in the code. In simple words, debugger will remain in the same section of code until you keep pressing F10.

Literally speaking, F10 will step over ( or not enter into) any functions/triggers/events which come in its way.

6. Shift + F11 (Step Out) - If the debugger is in a particular section of code and we press Shift + F11, then the debugger will jump back to the previous code section from the call stack and if there is no other code section previous to the current, then debugging will push control back to RTC and the intended process will execute.

7. F5 (Continue) - Will debug only breakpoints. Debugger will take you to the first breakpoint which has been applied in code and then to the next and so on.

Coming to breakpoints, lets talk about them

8. F9 (Apply a breakpoint) - It applies breakpoints anywhere in the code while debugging. You may apply breakpoint through development environment also by using F9 key.

This is what a breakpoint looks like, A red dot!

There are more shortcuts but they are not used much by me.

Thanks. Keep Learning!