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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Unable To scan QR code on Invoice

(0) ShareShare
ReportReport
Posted on by 73

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;

I have the same question (0)
  • Automatic login in business central Profile Picture
    73 on at

    Can anyone suggest for this

  • Suggested answer
    Gianfranco C. Profile Picture
    374 on at

    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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 653 Super User 2026 Season 1

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 414 Most Valuable Professional

#3
YUN ZHU Profile Picture

YUN ZHU 394 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans