Posted on 04/08/2022 12:08:34
Hi Tomas,
not sure what you mean about the 1306/50027 numbers in BC, I was able to find 50027 table, and 1306 Record opens a "User preferences" table which is
not directly used anywhere in our code. If needed I can send you a pdf generation source code from the app.
Also if you want to implement a custom "pdf" request then you can subscribe to the event:
CustomerCenterPublisher.OnBeforeExecuteGetCustomerStatementPfRequest
and set a flag: stopExecution := true
and set the "response" variable with yours pdf 64bit string from BC.
The request format is:
<GetCustomerStatementPDF />
You can read the parameters from the input request using the code like that in your custom subscriber:
XmlHelper.GetTextFromNode(XMLdocIn.AsXmlNode(), '/GetCustomerStatementPDF/@customerID')
So unless you do not use this request in your system, you can override it with your custom subscriber and return your pdf.
In our pdf generation we use this:
ReportSelection: Record "Report Selections";
recordReference: RecordRef;
oStream: OutStream;
tempBlob: codeunit "Temp Blob";
SalesHeader.SETRANGE(SalesHeader."Document Type", SalesHeader."Document Type"::Order);
SalesHeader.SETRANGE("No.", DocumentNo);
SalesHeader.SETRANGE("Sell-to Customer No.", customer."No.");
recordReference.GetTable(SalesHeader);
tempBlob.CreateOutStream(oStream);
REPORT.SaveAs(ReportSelection."ReportId", '', ReportFormat::Pdf, oStream, recordReference);
BR, Dmitrij