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

Filter a report Based on Open Record

(0) ShareShare
ReportReport
Posted on by 264

Greetings to all of you!

My case is the one that i will explain briefly below:

I have already created a custom report for quote confirmations in a customer of mine.

The request page is the one below:

pastedimage1679669089482v1.png

As you can see here, i have the field QuoteNo, which has a table relation with sales header and allows the user to select one of the available quotes and then print the report.

What i need , is : 

Since the action button for the run of this report, is within the sales quote page , i would like to be able to pre-filter the report with the actual record that the user is in at this exact moment.

For example if the user has openned the sales quote page for the document PRF-000013, then , if QuoteNo is empty, the report must be printed for the PRF-00013, the record that the user sees in his UI.

This is standard in almost all the reports related to sales-purchases in business central , for example if i dont fill anyting in the request page of the Order Confirmation report, the system, somehow, will print to me the order confirmation only for the order that i am checking in my UI. I havent figured out from the source code,how this is possible to be done , thats why i need your help!!

Thank you all in advance for your help.

With respect,

Antonis

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

    Use a trigger like this one:

    trigger OnAction()

                       var

                           SalesHeader: Record "Sales Header";

    SomeReport: Report YourReport;

                       begin

                           SalesHeader := Rec;

                           SalesHeader.SetRecFilter();

                         SomeReport.SetTableView(SalesHeader);  

                         SomeReport.Run;

                           end;

  • AntonisK Profile Picture
    264 on at

    Perfect Sir

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

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 757 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 451 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 391 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans