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...
Answered

Populate Filter based on selected Filter

(0) ShareShare
ReportReport
Posted on by 55

Hi,

I'm trying to populate a filtered list on a report based on the value that is selected on another filter that was selected:

pastedimage1664533425050v1.png



pastedimage1664533827018v2.png



First I'm getting the Sales Order Numbers and Lot Numbers populated with custom filters.

If I 'hard code' then I can get the lot numbers populate but the selection is not working as the lot number is a Primary key on the Lot table

  trigger OnPreDataItem()
                    begin
                        SetRange("Source No. 3", LotNumberFilter);
                    end;
 trigger OnPreDataItem()
            begin
                SetRange("No.", SoNumberFilter);
            end;



1) How can I get the value  from the filter that is selected on the Sales Order Number
2) How can I create a 'lookup' or table relation so that the Lot Numbers will only populate according to the value that was selected on the first filter

                }


group(General)
                {
                    field(SoNumberFilter; SoNumberFilter)
                    {
                        TableRelation = "Sales Line"."Document No.";
                        ApplicationArea = All;
                        Caption = 'Please filter on a Sales Order Number: ';
                    }
                    field(LotNumberFilter; LotNumberFilter)
                    {
                        //TableRelation = "Lot No. Information"."Lot No.";
                        TableRelation = "Sales Line"."No." WHERE("Document No." = const('SO10190'));
                        ApplicationArea = All;
                        Caption = 'Please filter on a Lot Number: ';
                    }




I have the same question (0)
  • Suggested answer
    Andy Sather Profile Picture
    Microsoft Employee on at

    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

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

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,161 Moderator on at

    Because you are only submitting part of your code, it is a bit hard to see what you really are trying to do here.

    But it can look like you try to have a page with a page part.

    In order to achieve that you need to use a sub page link as described here:

    learn.microsoft.com/.../devenv-subpagelink-property

    Or is it only the lot numbers in your request page that should be filtered by sales order no?

    These cases are easier solved if you share the complete code instead of just screen shots of it. f you use rich formatting when writing your post you can insert code.

  • Verified answer
    Amit Baru Profile Picture
    3,037 on at

    Hi,

    Create button on Sales Line page

    setrange("Document No.",DocumentNo);

    Report.run(True,False,Rec);

    Regards

    Amit Sharma

    www.erpconsultors.com

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,055 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,063 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 1,014 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans