RE: Trigger for Drilldown
I have created a small model which you can follow.
Added a field to the Customer to count the Open Cust. Ledger Entries:
field(50100; "BP Open Entry Count"; Integer)
{
Caption = 'Open Entry Count';
Editable = false;
FieldClass = FlowField;
CalcFormula = count("Cust. Ledger Entry" WHERE("Customer No." = FIELD("No."), Open = Const(true)));
}
On the Customer Card I added the field and a drilldown:
addlast(General)
{
field(BalanceDrillDown; Rec."BP Open Entry Count")
{
ApplicationArea = All;
Caption = 'Drill Down Balance';
DrillDown = true;
trigger OnDrillDown()
var
CustLedgerEntry: Record "Cust. Ledger Entry";
begin
CustLedgerEntry.SetRange("Customer No.", Rec."No.");
CustLedgerEntry.SetRange(Open, true);
Page.RunModal(Page::"Customer Ledger Entries", CustLedgerEntry);
end;
}
}
This should give you enough to go on with your example. I am not clear on your requirements, but you may want to filter the journals a bit more than just a match on No.
If the flowfield source has a page assigned to it, you do not need to specify the page in the parameter and can use 0.