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

How to pass multiple filter values to a Report Request

(0) ShareShare
ReportReport
Posted on by 55

Hi,

I've written a page extension to add a custom report directly on the Sales Order.

pageextension 50210 APTRRC_SalesOrder extends "Sales Order"
{
    actions
    {
        addafter(AttachAsPDF)
        {
            action(APTRRC_ASNLabel)
            {
                Caption = 'Certificate Of Analysis';
                Promoted = true;
                Image = Report;
                PromotedCategory = Category11;
                ApplicationArea = All;
                trigger OnAction()
                var
                    SOLine: Record "Sales Line";
                begin
                    SOLine.Reset();
                    SOLine.SetRange("Document No.", "No.");
                    Report.Run(50001, true, true, SOLine);
                end;
            }
        }
    }
}

Report

report 50001 APTRRC_CertificateofAnalysis
{
    DefaultLayout = Word;
    WordLayout = '.\src\Business Central\src\reportLayout\Certificate of Analysis.docx';
    Caption = 'Certificate of Analysis';
    UsageCategory = Lists;
    AccessByPermission = report APTRRC_CertificateofAnalysis = X;
    ApplicationArea = All;

    dataset
    {
        dataitem(SOHeader; "Sales Header")
        {
            RequestFilterFields = "No.";
            column(Order_Date; "Order Date")
            {
                IncludeCaption = true;
            }
            column(External_Document_No_; "External Document No.")
            {
                IncludeCaption = true;
            }

            column(No_; "No.")
            {
                IncludeCaption = true;
            }

            column(Sell_to_Customer_No_; "Sell-to Customer No.")
            {
                IncludeCaption = true;
            }

            dataitem(CustomerInfo; Customer)
            {
                DataItemTableView = sorting("No.");
                DataItemLink = "No." = field("Sell-to Customer No.");

                column(Name; Name)
                {
                    IncludeCaption = true;
                }
                column(Ship_to_Code; "Ship-to Code")
                {
                    IncludeCaption = true;
                }
                column(E_Mail; "E-Mail")
                {
                    IncludeCaption = true;
                }
            }

            dataitem(SalesLines; "Sales Line")
            {
                DataItemTableView = sorting("Document No.");
                RequestFilterFields = "Document No.", "Lot No.";
                DataItemLink = "Document No." = field("No.");
                column(ItemNo_; "No.")
                {
                    IncludeCaption = true;
                }
                column(Description; Description)
                {
                    IncludeCaption = true;
                }
                column(Bin_Code; "Bin Code")
                {
                    IncludeCaption = true;
                }

                column(Lot_No_; "Lot No.")
                {
                    IncludeCaption = true;
                }
                dataitem(QAExpiryDate; "Tracking Specification")
                {
                    DataItemLink = "Source ID" = field("Document No."), "Lot No." = field("Lot No."), "Item No." = field("No.");
                    column(Expiration_Date; "Expiration Date")
                    {
                    }
                }
                dataitem(QA; "QA Answer")
                {
                    RequestFilterFields = "Source No. 3";
                    column(QA_Questionnaire_Code; "QA Questionnaire Code")
                    {
                        IncludeCaption = true;
                    }
                    column(QA_Question_Category_Code; "QA Question Category Code")
                    {
                        IncludeCaption = true;
                    }

                    column(Answer; Answer)
                    {
                        IncludeCaption = true;
                    }
                    column(Source_No_; "Source No.")
                    {
                        IncludeCaption = true;
                    }

                    column(Source_No__3; "Source No. 3")
                    {
                        IncludeCaption = true;
                    }

                    dataitem(QAC; "QA Question Category")
                    {
                        DataItemLink = "Code" = field("QA Question Category Code");

                        column(CategoryDescription; Description)
                        {
                            IncludeCaption = true;
                        }
                    }



                    dataitem(QAHeader; "QA Header")
                    {
                        DataItemLink = "Source No." = field("Source No."), "Source No. 3" = field("Source No. 3");
                        column(HeaderQuestionnaire_Code; "QA Questionnaire Code")
                        {
                        }
                        dataitem(ExpiryDate; "QA Questionnaire Header")
                        {
                            DataItemLink = "Code" = field("QA Questionnaire Code");
                            column(Ending_Date; "Ending Date")
                            {
                                IncludeCaption = true;
                            }
                        }
                    }

                }
            }

        }
    }

}


The report appears with the Document Number in the filter - I want to make it better by passing the Lot Numbers as well that are on the Sales Order Lines

pastedimage1665773820027v1.png

Any suggestions how to do that?

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    To be able to do that you should extend the sub page  "Sales Order Subfom"instead of the main page.

    So extend the page where you show the sales lines. Then you will have access to the serial no. of your selected sales line.

  • Suggested answer
    Amit Profile Picture
    2,563 on at

    Hi,

    Make extension of Report for adding the Filter in the Request page.

    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

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 740 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 531 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 310 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans