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

Print New SalesInvoice using button

(0) ShareShare
ReportReport
Posted on by 383

Hello every one,

i create a new report with new data set for SalesInvoice i need to create button in "posted sales invoice form" and pass the selected record value to the report to print

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    Just create a pageextension of your standard page (posted sales invoice), add a new action and from this action you can call your new report (report.run(XXXXX, Rec)).

  • Asif Shahzad Profile Picture
    410 on at

    Hello, how you create new data set for saleinvoice. I also need to add new fields in sale invoice. Need to create new report from scratch as we cannot extend report.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    Yes you need to create a new report (start by copying the existing one) and then use this new report.

  • Verified answer
    divyeshchitte Profile Picture
    970 on at

    Try Adding this code on Action.

    SalesHeader := Rec;

    SalesHeader.SetRecFilter;

    REPORT.RunModal(REPORT::"New Report", true, false, SalesHeader);

    I will suggest to Change the Report id in Report Selection Sales

    Search for Report Selection Sales In that select Invoice and Add new report id so it will automatically print your new Report from the existing print Button

  • AhmedSaeed Profile Picture
    383 on at

    Hi Divyesh Chitte ,

    I try take object from salesinvoiceHeader as you do above but i can,t

  • AhmedSaeed Profile Picture
    383 on at

    The problem Solved using This cod in OnAction()

    trigger OnAction();

                   var

                       SalesRec: Record "Sales Invoice Header";

                       Myreport: Report modSalesInvoiceReport;

                   begin

                       ;

                       Clear(SalesRec);

                       SalesRec := rec;

                       SalesRec.SetRecFilter;

                       Myreport.SetTableView(SalesRec);

                       Myreport.RunModal();

                   end;

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,216 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,471 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,369

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans