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

Notifications

Announcements

No record found.

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
    370 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,116

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 764 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 635 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans