web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Trigger for Drilldown

(0) ShareShare
ReportReport
Posted on by 55

Hi All,

I'm trying to create a drilldown for my table and page extension that i recently created.

The Table extension is called "Selected Pmts" 

I added this trigger to the Pageextension, but i'm not sure where i went wrong.

Can anyone assist?

pageextension 50103 "Selected Pmts" extends "Bank Account List"
{
layout
{
addafter(BalanceAmt)

field("Selected Pmts"; Rec."Selected Pmts")
            {
                ApplicationArea = all;
                Caption = 'Selected Pmts';
                DrillDown = true;
                 trigger OnDrillDown()
                var
                selpmt: Record "Bank Account"
                begin
                    selpmt."Selected Pmts"(Rec."Selected Pmts");
                    Page.Run(Page:: "Payment Journal");
                end;
                }
                }
                }
                
            

I have the same question (0)
  • Rajiv Sewsarran Profile Picture
    55 on at
    RE: Trigger for Drilldown

    resolved with above solution 

  • Rajiv Sewsarran Profile Picture
    55 on at
    RE: Trigger for Drilldown

    Hi Brad,

    This was a great help!

    thanks

  • Suggested answer
    Nitin Verma Profile Picture
    21,666 Moderator on at
    RE: Trigger for Drilldown

    Hi,

    You have to replace this below line with Setrange and please try to put unique name of each field, variable, pages and functions I can see you are using same name everywhere.

    selpmt."Selected Pmts"(Rec."Selected Pmts");

    Thanks.

  • Verified answer
    Brad_P Profile Picture
    1,549 on at
    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.

  • Rajiv Sewsarran Profile Picture
    55 on at
    RE: Trigger for Drilldown

    Clcl.PNG

  • Rajiv Sewsarran Profile Picture
    55 on at
    RE: Trigger for Drilldown

    Apologies,

    Here it is

               CalcFormula = Sum("Gen. Journal Line".Amount WHERE("Bal. Account No." = FIELD("No.")));

  • Rajiv Sewsarran Profile Picture
    55 on at
    RE: Trigger for Drilldown

    sorry im not sure i follow

  • Brad_P Profile Picture
    1,549 on at
    RE: Trigger for Drilldown

    This is not the calcformula property on the field that you had added.

  • Rajiv Sewsarran Profile Picture
    55 on at
    RE: Trigger for Drilldown

    HI Brad,

    Here's the calcformula

    procedure GetProjBal(): Decimal

       begin

           CalcFields(Balance, "Selected Pmts");

           exit(Rec.Balance - Rec."Selected Pmts");

       end;

  • Brad_P Profile Picture
    1,549 on at
    RE: Trigger for Drilldown

    What is the CalcFormula properties on the field that you added?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 4,220

#2
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 3,958

#3
Sumit Singh Profile Picture

Sumit Singh 2,961

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans