dataset
{
dataitem(/Bank Account Ledger Entry/; /Bank Account Ledger Entry/)
{
UseTemporary = true;
column(Bank_Account_No_; /Bank Account No./) { }
column(Amount__LCY_; /Amount (LCY)/) { }
column(CountryName; CountryName) { }
column(Sectors; /Shortcut Dimension 7 Code/) { }
column(Categorycode; /Shortcut Dimension 6 Code/) { }
trigger OnPreDataItem()
begin
SetRange(/Posting Date/, 0D, EndDate);
end;
trigger OnAfterGetRecord()
begin
Clear(CountryName);
CountryRegion.Reset();
if CountryRegion.Get(/Country/Region Code/) then
CountryName := CountryRegion.Name;
bankCount := /Bank Account Ledger Entry/.CountApprox;
end;
}
dataitem(Integer; Integer)
{
column(TotalBALE; TotalBALE) { }
column(FinalBALE; FinalBALE) { }
trigger OnPreDataItem()
begin
SetRange(Number, 1, bankCount);
CreditActivity.SetRange(CreditActivity.PostingDateFilter, StartDate, EndDate);
CreditActivity.SetRange(CreditActivity.ShortcutDimension6Code, /Bank Account Ledger Entry/./Shortcut Dimension 6 Code/);
CreditActivity.SetRange(CreditActivity.ShortcutDimension7Code, /Bank Account Ledger Entry/./Shortcut Dimension 7 Code/);
CreditActivity.SetRange(CreditActivity.CountryRegionCode, /Bank Account Ledger Entry/./Country/Region Code/);
CreditActivity.Open();
end;
trigger OnAfterGetRecord()
begin
if CreditActivity.Read() then begin
TotalBALE := CreditActivity.AmountLCY;
end
else begin
CurrReport.Skip();
end;
end;
}
requestpage
{
layout
{
area(content)
{
group(Dates)
{
field(StartDate; StartDate)
{
Caption = 'Start Date';
ApplicationArea = All;
}
field(EndDate; EndDate)
{
Caption = 'End Date';
ApplicationArea = All;
}
}
}
}
actions
{
area(processing)
{
}
}
}
trigger OnPreReport()
begin
if StartDate = 0D then
Error('Start Date must have a value');
if EndDate = 0D then
Error('End Date must have a Value');
if EndDate < StartDate then
Error('End Date must not be greater than Start Date');
end;