Code Coverage- NAV 2016

Code Coverage is the tool for tracking which part of application code has been executed while posting the transaction. In Microsoft Dynamics NAV it is record by C/AL Code as it displays which specific line of code was executed while performing the activity.

User Can Access the Code coverage tool from Administration–>Application Tools–> Code Coverage

To Start monitoring the activity use need to click on Start button .This will start recording the code coverage activities. Once activities completes then one need to ‘Refresh’ to see the activities.

This code coverage windows will show all the details like

1) Code column  will show all the objects executed during the processing of transactions which includes Tables,Pages,Code units,Reports .Once you drill down the on the object you can see which lines of code is executed during processing of transactions.

2) Coverage columns will show How much coverage % is used by the object while processing the transactions

3) Line Type columns will show details like object,Trigger/Function, code etc.

4) Object Type column will show the object type which executed during the transaction processing i.e Table,Codeunit,Page etc

5) Object Id column will show object number of object

6) Line No column will show which line from code written is executed

7) No of Lines Displays Total no of lines of code

8) No of Hits  Displays total no of hits for the code is executed during transaction processing

9) No of Hit Lines Display total no of lines executed

10) No of Skipped Lines Displayed total no of skip lines

Code Coverage will display only those object which are executed /touched during the transactions processing.

For specific coverage of any objects you can use ‘Load Objects’ from ribbon area to load the objects and then code coverage will track the activity of that object even though no lines are covered.

You have facility to export the code coverage summary using export option

Important :- Code coverage is recorded globally for all sessions so you have to take care while recording the activity.


General Availability of NAV 2017 Announced

Finally the most awaited NAV 2017 version availability announced by Microsoft with lot more things

NAV 2017 will be released on 24th October 2016

New developer Environment will be available in Christmas (Gift from Santa Gift)

Item Attributes-NAV 2017

In NAV 2017 you can organize and classify your products by using attributes and you can display the information you need. These attributes can be displayed on Fact box and Item card

One can define own type of attributes including text,integer and decimal. The option and values can be translated to support multilingual requirements. If attributes not required then you can block those attributes.

and Many more……

Original post from Microsoft

Table Type In NAV 2016

Nice features in NAV 2016 Table i.e One can specify the Table type

Earlier version we are using property called ‘LinkedObject’ to link the external table/view.

In New version we have property Table type which contains three different type as follows called ExternalSql’  wherein one can specify table/view from sql server that is not in MS Dynamics NAV DB

  • Normal :- Specified the table as normal table . This is default value whenever you create table in NAV
  • CRM:- Integration table for integrating NAV with Microsoft dynamics CRM
  • ExternalSQL:- Specify the table/view in sql server which is not in NAV database.

When one select ‘ExternalSQL’ two other properties will enable automatically

1) ExternalName :- specify the name of external table from database

2) External Schema :- Specify the database schema.


You can look at How to register External Tables



Send Document

In NAV 2016 on Posted Sales Invoice screen option is provided to send documents to multiple source like

  • Send to Printer ,
  • Send document by email to customer,
  • Save it to disk
  • Send document to exchange service.

One can find the option on Posted Sales Invoices as follows

In this option user can send document to directly to printer or send document via email or save the document to disk  in PDF format. This will basically reduce the work the save the file in PDF and then attach it to email  and send to customer.

In the above option when user click on option where one can select to Use ‘Yes (Use Default Settings)’ or ‘Yes (Prompt for Settings)’.

1) Yes (Use Default Settings):- This will use default settings  of system for printer,email etc.

2) Yes (Prompt for Settings) :- By selecting this option user can configure

For example if user selected email option for prompt for settings then screen will look like

In this screen user can add details required options and send email .If you selected ‘Edit in Outlook’ so email will open in default outlook client and you can edit the message Big Smile



NAV Client Development

Recently I was exploring Web Client of NAV 2016  (One of nice client of NAV) and found that lot of things got disturbed when view the custom pages on web client (I was under impression that everything will show correct on web pages automatically).Of  course I read the limitations of NAV but I was not aware that it will hamper so much on custom pages where we are  switching controls  based on the condition/process i.e show/hide the controls.

But now what to do this is not working as per windows client  Sad

Am I need to do fresh development for web pages ??? Oh this will kill the time and more on investment.

By searching I come across some new functions defined by NAV and I was like Big SmileBig Smile

They come up with something like DEFAULTCLIENTTYPE,CURRENTCLIENTTYPE functions

Using these function one can write the different code for different client like Windows,Web,Tablet,Mobile

How Do I use:

Defaulclienttype :- This functions always return the value ‘Windows’ even after viewing on other client of NAV

CURRENTCLIENTTYPE :- This functions return the NAV client type that is running in current session. As well as one can use this function to GetURL of the current client

One can written the different program for web client and windows client.

You can write something like

    <Your program goes here>

To Get URL
You can write


Using this functions could manage some of functionalities to view on the web client but still some resistance (due to limitations of web client) is there.

If the page contains any actions button switch off/on based on some process and one has return program using visibility property of page  then it will not refresh automatically one Need to press ‘F5’ whenever the page need to refresh. Surprise

Hope in coming future Microsoft will come up with some features which will enable everybody to use web client just like windows client (RTC)

Looking forward for NAV 2017 Web Client.


Notifications in UI -NAV 2017

This is really interesting feature introduced in NAV 2017 as Notifications in UI.

NAV 2017 comes up smarter way to send notifications to the UI in Web Client .This will provide notifications to the user about what is happening in transactions.

This will helpful during

1) Shortage on Inventory

2) Customer Balance is negative

3) Customer credit limit exceeded

and many more…….

In the development environment, you create notifications in C/AL by using the newNotification and NotificationScope data types and the following functions.
MESSAGE specifies the content of the notification that appears in the UI

  1. SCOPE specifies the scope in which the notification appears, which can be LocalScope or GlobalScope.
  2. SEND sends the notification to be displayed by the client.
  3. ADDACTION adds an action on the notification.
  4. SETDATA and GETDATA set and retrieve a data property value for the notification, which is typically needed when actions are invoked.

All the notifications will fire after the validations errors.


Account Categories in the Chart of Accounts- NAV 2017

This is one of the new improvement in Financial management -Chart of Account

Now one can define categories and subcategories in chart of account itself . This feature is useful for reporting purpose as well as categorization of ledgers.

Straight from MS :

We have added account categories and sub categories so you can group general ledger accounts to fit your need for financial reporting. For each G/L account, you can specify the account category so that ledger entries posted to this account are categorized as assets or liabilities, for example., or an income or an expense, and so on.
For each account category, you can choose between different sub-categories. You can also create new sub-categories to fit your need. For example, for the G/L account category Income, you can define as many sub-categories as you need so that you can differentiate between income from services and income from product sales.

I loved this feature as in initial version we have to add these as custom field and prepare reporting based on the same ( Specially in Indian version)