Hi,
You can write the below logic .
Page 60113 "LastDaySale"
{
PageType = CardPart;
RefreshOnActivate = true;
layout
{
area(Content)
{
cuegroup(cuegroup1)
{
Caption = 'Previous Day Sale';
field(LastDaySale; LastDaySalevar)
{
Caption = 'Prev Day Sale';
ApplicationArea = All;
StyleExpr = Style;
Lookup = true;
trigger OnDrillDown()
var
CustLedEntry: Record "Cust. Ledger Entry";
CustLedEntrylist: Page "Customer Ledger Entries";
CustLedEntry1: Record "Cust. Ledger Entry";
begin
Clear(CustLedEntry);
CustLedEntry.Reset();
Clear(CustLedEntry1);
CustLedEntry1.Reset();
Clear(CustLedEntrylist);
CustLedEntry.SetCurrentKey("Posting Date", "Global Dimension 1 Code");
CustLedEntry.SetFilter("Global Dimension 1 Code", '%1|%2|%3', 'SSD', 'IND', 'HID');
CustLedEntry.SetAscending("Posting Date", false);
// CustLedEntry.SetRange("Posting Date", CustLedEntry."Posting Date");
IF CustLedEntry.FindFirst() THEN BEGIN
CustLedEntry1.SetRange("Posting Date", CustLedEntry."Posting Date");
CustLedEntry1.SetFilter("Global Dimension 1 Code", '%1|%2|%3', 'SSD', 'IND', 'HID');
CustLedEntrylist.SETTABLEVIEW(CustLedEntry1);
CustLedEntrylist.Run();
end;
end;
}
}
}
}
trigger OnAfterGetCurrRecord()
var
CustLedEntry: Record "Cust. Ledger Entry";
CustLedEntry1: Record "Cust. Ledger Entry";
CustLedEntrylist: Page "Customer Ledger Entries";
begin
Clear(CustLedEntrylist);
Clear(CustLedEntry);
CustLedEntry.Reset();
Clear(CustLedEntry1);
CustLedEntry1.Reset();
Clear(LastDaySaleVar);
CustLedEntry.SetCurrentKey("Posting Date");
CustLedEntry.SetFilter("Global Dimension 1 Code", '%1|%2|%3', 'SSD', 'IND', 'HID');
CustLedEntry.SetAscending("Posting Date", false);
IF CustLedEntry.FindFirst() THEN begin
CustLedEntry1.SetRange("Posting Date", CustLedEntry."Posting Date");
CustLedEntry1.SetAutoCalcFields("Amount (LCY)");
if CustLedEntry1.FindSet() then
repeat
LastDaySaleVar := CustLedEntry1."Amount (LCY)" + LastDaySalevar;
until CustLedEntry1.Next() = 0;
end;
end;
var
LastDaySalevar: Decimal;
style: Text;
}
If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much