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

Notifications

Announcements

No record found.

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,166 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,166 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
    968 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,135

#2
YUN ZHU Profile Picture

YUN ZHU 733 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 612

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans