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

  • AhmedSaeed Profile Picture
    383 on at
    RE: Print New SalesInvoice using button

    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;

  • AhmedSaeed Profile Picture
    383 on at
    RE: Print New SalesInvoice using button

    Hi Divyesh Chitte ,

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

  • Verified answer
    divyeshchitte Profile Picture
    950 on at
    RE: Print New SalesInvoice using button

    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

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: Print New SalesInvoice using button

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

  • Asif Shahzad Profile Picture
    384 on at
    RE: Print New SalesInvoice using button

    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
    RE: Print New SalesInvoice using button

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

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

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

#1
YUN ZHU Profile Picture

YUN ZHU 628 Super User 2025 Season 1

#2
Mansi Soni Profile Picture

Mansi Soni 495

#3
Sagar Dangar, MCP Profile Picture

Sagar Dangar, MCP 395

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans