Skip to main content

Notifications

Community site session details

Community site session details

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

How to trigger a Trigger OnDrillDown on a Page Field unvisible ?

(0) ShareShare
ReportReport
Posted on by 215

Hello,

Here is my situation. I want to modify the "AutoFormatType" and "AutoFormatExpression" properties of the field "Total Quantity" of the Table 338 "Entry Summary". I know I can't. So my usual workaround is to go into the pages refering to this table field, to put the standard page field to "Visible = false", to create a new field in the page extension refering to the table field, and to add the properties "AutoFormatType/Expression" to my new field.

But...

In this case, there is a But. I'm in the Page 498 Reservation, refereing to the Table 338 "Entry Summary" as SourceTable. There is a field "Total Quantity" in this page. And in this field page, there is a trigger OnDrillDown calling the local procedure DrillDownTotalQuantity.

                field("Total Quantity"; ReservMgt.FormatQty("Total Quantity"))
                {
                    ApplicationArea = Reservation;
                    BlankZero = true;
                    Caption = 'Total Quantity';
                    DecimalPlaces = 0 : 5;
                    Editable = false;
                    ToolTip = 'Specifies the total quantity of the item in inventory.';

                    trigger OnDrillDown()
                    begin
                        DrillDownTotalQuantity;
                    end;
                }
    local procedure DrillDownTotalQuantity()
    var
        Location: Record Location;
        AvailableItemTrackingLines: Page "Avail. - Item Tracking Lines";
    begin
        if HandleItemTracking and ("Entry No." <> 1then begin
            Clear(AvailableItemTrackingLines);
            AvailableItemTrackingLines.SetItemTrackingLine(
                "Table ID", "Source Subtype", ReservEntry, ReservMgt.IsPositive, ReservEntry."Shipment Date");
            AvailableItemTrackingLines.RunModal;
            exit;
        end;

        ReservEntry2 := ReservEntry;
        if not Location.Get(ReservEntry2."Location Code"then
            Clear(Location);

        OnDrillDownTotalQuantity(SourceRecRef, Rec, ReservEntry2, Location, QtyToReserveBase - QtyReservedBase);

        UpdateReservFrom();
    end;

If I try to apply my usual workaround, I'll create a new field that won't be able to call this local procedure with my new field. But I want to. So I'm trying to find a way to trigger the OnDrillDown trigger inside the stadard page field "Total Quantity", even when this field has the property Visible = false.

Do you know workaround possible here ?

  • Suggested answer
    Andy Sather Profile Picture
    on at
    RE: How to trigger a Trigger OnDrillDown on a Page Field unvisible ?

    Hello  - We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,169

#2
YUN ZHU Profile Picture

YUN ZHU 1,006 Super User 2025 Season 1

#3
Mansi Soni Profile Picture

Mansi Soni 830

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans