2
from closed https://github.com/microsoft/AL/issues/6388

**Describe the bug**
The title says it all: if a `List` page is in View mode, and no records are within its Table/filter, then the `DataCaptionExpression` the developer sets is ignored and not shown at the top.

A `DataCaptionExpression` that depends only on the page filters or some other non-record-specific data is not possible in view mode; it just does not get shown. This harms developer and user experience. For instance, a page of 'entries' that can be attached to any specific record - ideally we should see the record type/ID as the caption, but this breaks it.

**To Reproduce**
```al
page 50100 TestList
{
Caption = 'Test List';
DataCaptionExpression = DataCaptionExpressionText;
PageType = List;
SourceTable = "Customer";
SourceTableView = where(Name = const('impossible'));
UsageCategory = None;

layout
{
area(Content)
{
repeater("Group")
{
field("No."; Rec."No.")
{
ApplicationArea = All;
ToolTip = 'Specifies the No.';
}

field(Name; Rec.Name)
{
ApplicationArea = All;
ToolTip = 'Specifies the Name';
}
}
}
}

var
DataCaptionExpressionText: Text;

trigger OnOpenPage()
begin
DataCaptionExpressionText := 'DataCaptionExpressionText'
end;
}
```

**Expected behavior**
It should be possible to set a `DataCaptionExpression`, regardless of whether any record exist and/or whether we are in View/Edit mode, since it might not depend on fields from the record (e.g. might only depend on the page filters). But currently we don't see the `DataCaptionExpression` on the page if in View mode and no records exist. We **do** see it if in Edit mode (even if no records exist) or in View mode with >=1 record(s) existing.

**Screenshots**
Edit - shows `DataCaptionExpression`:
![image](https://user-images.githubusercontent.com/63455896/102626643-00607a80-413f-11eb-9757-34b5e219a470.png)
View - does not show `DataCaptionExpression`:
![image](https://user-images.githubusercontent.com/63455896/102626584-ea52ba00-413e-11eb-8947-c012d1adf871.png)

**5. Versions:**

- AL Language: 6.1.381323

- Business Central: GB Business Central 17.2 (Platform 17.0.19353.19941 + Application 17.2.19367.19525)
Category: General
STATUS DETAILS
Needs Votes
Ideas Administrator

Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future. Best regards, Business Central Team