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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

How can we get filtered page for table dropdown field and table lookup field with respective filters on page using AL code in business central

(0) ShareShare
ReportReport
Posted on by

we have a table with two different pages, In the table, field1 should get a filtered page using the dropdown, and field2 should get a filtered page using lookup with respect to the filters applied on pages using AL code in business central saas. Please help us how can we achieve this.

Thanks in advance

Satya

  • Lars Lohndorf-Larsen Profile Picture
    Microsoft Employee on at

    Hello Satya,

    I am not sure I have hit your exact requirements but I made a small sample page below with two fields, each one has a lookup that opens a filtered Item list, and then you can select from that list. If this was not what you were looking for, just let me know and I will try to think of something else.

    beware that in the web client there is not a big distinction between lookup and drilldown, and in case you make a field uneditable, then the drilldown disappears. For example if you do not want users to type in a value manually but still be able to choose from a list. So my advice will be for you to just use OnLookup triggers, but this is only a suggestion for consideration, since of course I dont know your whole set of specifications.

    page is below - I hope it helps:

    page 50101 FilterPage

    {

       PageType = Card;

       ApplicationArea = All;

       UsageCategory = Administration;

       layout

       {

           area(Content)

           {

               group(GroupName)

               {

                   field(Drilldown; Value1)

                   {

                       Caption = 'Drilldown';

                       ApplicationArea = All;

                       trigger OnDrillDown()

                       begin

                           item.reset;

                           Item.calcfields("Assembly BOM");

                           Item.setrange("Assembly BOM", true);

                           if page.RunModal(0, Item) = action::LookupOK then

                               Value1 := Item.Description

                           else

                               Value1 := '';

                       end;

                   }

                   field(Lookup; Value2)

                   {

                       Caption = 'Lookup';

                       ApplicationArea = all;

                       trigger OnLookup(var Text: Text): Boolean

                       begin

                           item.reset;

                           Item.setfilter("No.", '1896-S|1906-S|1928-S');

                           if page.RunModal(0, Item) = action::LookupOK then

                               Value1 := Item."No."

                           else

                               Value1 := '';

                       end;

                   }

               }

           }

       }

       actions

       {

           area(Processing)

           {

               action(ActionName)

               {

                   ApplicationArea = All;

                   trigger OnAction()

                   begin

                   end;

               }

           }

       }

       var

           Item: Record Item;

           Value1, Value2 : Text;

    }

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 631 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 409 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 222 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans