Dear Team,
I have created below code to generate QR code and print on sales invoice. I'm working on business central cloud India localization. After scanning QR code on invoice, Getting error Message "Unable to verify Qr code as Digital signature is invalid". Can anyone suggest me how i can achieve this?
local procedure GenerateQRCode(SalInvHeader: Record "Sales Invoice Header"; SignQr: Text)
var
BarcodeSymbology2D: Enum "Barcode Symbology 2D";
BarcodeFontProvider2D: Interface "Barcode Font Provider 2D";
BarcodeString: Text;
QRCode: Text;
os: OutStream;
Mystream: InStream;
EinvoiceLedger: Record EInvoiceLedgerEntries;
Os_iIN: OutStream;
Is_iIN: InStream;
TempBlob: Codeunit "Temp Blob";
QRgenerator: Codeunit "QR Generator";
begin
QRCode := SignQr;
TempBlob.CreateInStream(Is_iIN);
QRgenerator.GenerateQRCodeImage(QRCode, TempBlob);
SalInvHeader."QR Code".CreateOutStream(os);
CopyStream(os,Is_iIN);
SalInvHeader.Modify();
EinvoiceLedger.Reset();
EinvoiceLedger.SetRange("Document No", SalInvHeader."No.");
if EinvoiceLedger.FindFirst() then begin
// EinvoiceLedger.QR
QRCode := SignQr;
TempBlob.CreateInStream(Is_iIN);
QRgenerator.GenerateQRCodeImage(QRCode, TempBlob);
EinvoiceLedger.QR.CreateOutStream(os);
CopyStream(os,Is_iIN);
EinvoiceLedger.Modify();
end;
end;
hi, I don't know what your codeunit 'QR Generator' does, but from the code you pasted, you could try cleaning the variables TempBLob , InStream, OutStream, before generating the second QrCode.
Don't forget to help the community by Verifying the answer and Like it if your question has been answered. It will let others know that the topic has verified answer.
Thanks & Regards,
Gian
Can anyone suggest for this
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156