Search This Blog

Comment and Uncomment Selection in Navision

One of the small features in Microsoft Dynamics NAV is the ability to comment a selection of code.

Now I am not a huge believer in putting comments in code. Actually I am of the school that think comments are evil, because code should be written so it explains itself. That aside I find the new feature handy when testing and you want to take something out just for a test run.

How does it work?

If you are in the code you can mark a few lines of Code like this


Then click “Comment Seletion…” under the Edit Menu or use the shortcut Shift+Ctrl+K and the marked lines will be commented out by setting 2 forward slashes in front of the code at the left margin.


There is also an “Uncomment Seletion…” with the shortcut Shift+Ctrl+O that will remove the comments again.

Absolutely a help to developers, but please consider how you use comments.

Comments should not be needed in the final version of great code.