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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Business Central forum

Adjust print function

(0) ShareShare
ReportReport
Posted on by

Hey guys,

I need a print function for my extension.

I have created some tables and pages and now I need an action on one of my pages.

That action should be something like "Print" or "PrintRecords".

It should work like the print function on the "Posted Sales Invoice".

Do you know how I should adjust that standard function from there?

pastedimage1564480507042v1.png

I have no idea, which value I have to take for "Usage"...

Thank you :)

Categories:
I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,251 Super User 2025 Season 2 on at

    Are you trying to print the sales invoice? what does your table/page records contain?  if it is a custom table you don't have that usage option in the report selection.

    This is for Posted Sales Invoice

    PROCEDURE PrintRecords@1(ShowRequestForm@1000 : Boolean);

       VAR

         ReportSelection@1001 : Record 77;

         EInvoiceMgt@1020001 : Codeunit 10145;

       BEGIN

         WITH SalesInvHeader DO BEGIN

           COPY(Rec);

           FIND('-');

           EInvoiceMgt.EDocPrintValidation("Electronic Document Status","No.");

           ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"S.Invoice");

           ReportSelection.SETFILTER("Report ID",'<>0');

           ReportSelection.FIND('-');

           REPEAT

             REPORT.RUNMODAL(ReportSelection."Report ID",ShowRequestForm,FALSE,SalesInvHeader);

           UNTIL ReportSelection.NEXT = 0;

         END;

       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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans