bcquality/microsoft/knowledge/ui/validate-request-page-input-in-onqueryclosepage.good.al
Jesper Schulz-Wedde 4f0a13a801
Promote knowledge for Microsoft review skills (#153)
Move canonical knowledge for Microsoft-owned review domains into the Microsoft layer and document the skill/knowledge co-location policy.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Co-authored-by: Jesper Schulz-Wedde <jesper.schulzwedde@microsoft.com>
Copilot-Session: 2a6ea875-d38e-4f30-aadb-0d606f9be231
2026-09-03 15:06:01 +02:00

62 lines
1.7 KiB
AL

report 50547 "Sample Statement Good"
{
ApplicationArea = All;
UsageCategory = ReportsAndAnalysis;
Caption = 'Sample Statement Good';
dataset
{
dataitem(CustLedgerEntry; "Cust. Ledger Entry")
{
column(CustomerNo; "Customer No.") { }
column(Amount; Amount) { }
}
}
requestpage
{
layout
{
area(content)
{
group(Options)
{
field(StatementDateField; StatementDate)
{
ApplicationArea = All;
Caption = 'Statement Date';
ToolTip = 'Specifies the date the statement is printed for.';
ShowMandatory = true;
}
}
}
}
trigger OnQueryClosePage(CloseAction: Action): Boolean
begin
// Only when the user confirmed the run. Erroring on Cancel or Esc
// would trap the user in a page that refuses to close. The error
// itself keeps the page open, so the date can be fixed in place.
if CloseAction = Action::OK then
CheckStatementDate();
end;
}
var
StatementDate: Date;
StatementDateMissingErr: Label 'Enter a statement date.';
trigger OnPreReport()
begin
// The same check for runs that have no request page: job queue entries,
// Report.Run with the request window suppressed, scheduled and
// web-service invocations.
CheckStatementDate();
end;
local procedure CheckStatementDate()
begin
if StatementDate = 0D then
Error(StatementDateMissingErr);
end;
}