Code Coverage in Navision (available off of the tools menu -> debugger -> Code Coverage) is useful if you want to run through a process and see exactly what code is being hit.  Helpful from time to time in identifying spots where things are happening in code or where you can hook new functionality into.   I’m sure people are already doing this and saying “Duh” to themselves as they read this.   I didn’t really think about it and put up with scrolling or trying to do searches whenever I used code coverage.  I decided it must be keeping track of more than just the code to be able to color code what was hit. Indeed.

After starting code coverage and running through a process you’ll have a list of objects whose code was touched.  You can go to each object and hit the code button to see what happened.

This view isn’t very helpful depending on what you’re looking for. Black for code that was hit and red if it wasn’t hit.

I edit this form and add some additional columns that exist in the code coverage table.   I add columns for “Line No.”, “No. of Hits”, “Object Type”, “Object ID” and “Line Type”.

I now have a list that I can filter on “No. of Hits”  > zero and quickly see any code that was used in that object.  The “Object Type” and “Object ID” columns are useful if you remove all of the filters and have all the code showing across all objects.

capture1.jpg capture2.jpg capture3.jpg capture5.jpg

Share and Enjoy:
  • Print
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed