Friday, February 20, 2015

How to change Page Title BAR Caption

I have been asked this question couple of times, so I thought I would write a small blog about this.

On every page it displays some information about the selected record, for example in the below screenshot on the customer card it displays customer no. and name, can we control what to display on this title bar or left of the caption on page? and the answer to the question is yes. if so how?


On the table there is a property called “DataCaptionFields” which controls what to display in the title bar. So in this example if I check customer table the DataCaptionFields is set to No.,Name. So let me change that to display the City, now my DataCaptionFields is set to No.,Name,City and after the change it is displaying  the city in the title bar. So anytime you want to change the caption use this property and I think this is a very useful property because it is easy to find the right  information on the title bar and instead of looking over all the tabs on the page.

My Suggestion is to limit to use to 2-4 fields on this property.


But wait a minute there is a same property on the page, so when is that used ? According to Microsoft help the DataCaptionFields property on the table is used for card pages and if nothing is defined primary key is used. The value on the page is ignored for card pages.

For tabular pages:

Tabular pages show multiple records at a time. The following data caption rules are applied:

A data caption is only displayed if a filter containing the fields defined in the DataCaptionFields property for the page evaluate to one value. In this case, two situations are possible:

There is a table relation (as defined by the TableRelation Property) on one or more of the fields. In this case, the DataCaptionFields from the underlying table are used. If this table does not have a value for the DataCaptionFields property, the primary key for that table is used.

There is no table relation. In this case, the (single) value that results from evaluating the filter is used directly


There is also an example in the help, so please refer to that to know when Page DataCaptionFields will work.

If you have any questions or suggestions please leave a comment.


Application Profiler/CODE COVERAGE in Navision 2013 R2

In the previous versions of Navision we use to have code coverage which is used to trace C/AL Code and the developers used to have the ability to scan the piece of code which is executed during an action,process. This tool was very helpful in debugging. Even in Navision 2013 Microsoft shipped Application tool set which includes code coverage tool but in later version we don’t have this option.

In this blog I try to explain the options we have for Navision 2013 R2.  The tool which is available for Navision 2013 R2 is Application profiler and which can be downloaded from the following link

The downloaded file has DLLs and few objects in .txt format. It also has readme file which will guide you through the easy install process.  Rename the objects numbers if you already used them.

In order to run the code coverage run the Page 50000/ Performance Profiler


In order to trace the C/AL code for an action, please select the session you want to execute the trace for from the Target Session ID and click Start.

After executing the actions click stop. In the below example I executed the post action for the sales order.

The data it collects is combination of SQL Statements and C/AL code as shown in the below figure.


In order to view only the C/AL code try to set the filter for the object ID <> 0 and you will see all the C/AL statements it executed for the action. You can view all the code and analyze it from the result set.

I have not tested this on 2015 but I believe it will work on it. When I get sometime I will test it on NAV2015 and post the results.

Please leave your questions and suggestions in the comment section.