
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?
I have no idea, which value I have to take for "Usage"...
Thank you :)
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;