How to Change a Page Title Caption in Microsoft Dynamics NAV
On every page, some information about the selected record is displayed. For example, in the screenshot of the customer card below, the customer no. and name are displayed. The question is, can we control what to display on this title bar or to the left of the caption on the page? The answer to the question is yes. But how?
Figure 1 - Customer Card with customer name and no. highlighted
In the Customer Table, there is a property called "DataCaptionFields" which controls what to display in the title bar. So, in this example, if I check the Customer Table, the DataCaptionFields is set to No.,Name. So, I will change that to display the City. Now my DataCaptionFields is set to No.,Name,City, and after the change, the Customer Card will display the city in the title bar:
Figure 2 - Customer Card with No.,Name,City displayed in the Title Bar
So, anytime you want to change the caption, use this property. 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 yourself to 2-4 fields in this property.
But wait a minute. There is a same property on the page, so when is that used? According to Microsoft Help, the DataCaptionField property in the Table is used for card pages, and if nothing is defined, the primary key is used. The value on the page is ignored for Card Pages.
For tabular pages:
Tabular pages show multipe 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 relaton (as defined by the TableRelaton 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 Help, so please refer to that to determine when Page DataCaptionFields will work for tabular pages.