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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Copy qrcodeimage from salesheader to salesinvoiceheader

(4) ShareShare
ReportReport
Posted on by 355
i used same fieldid for both tables  salesheader and salesinvoiceheader
field(50199; "QRCodeImage"; Blob)
{
    Caption = 'QR Code Image';
}
in this field of sales header  i saved qrcodeimage and i want after posting it also saved in salesinvoiceheader table how is it possible
i also write eventhandler but it cannot work
   [EventSubscriber(
    ObjectType::Codeunit,
    Codeunit::"Sales-Post",
    'OnBeforeSalesInvHeaderInsert',
    '',
    false,
    false)]
local procedure CopyQRCodeToPostedInvoice(
    var SalesInvHeader: Record "Sales Invoice Header";
    SalesHeader: Record "Sales Header")
var
    InStr: InStream;
    OutStr: OutStream;
begin
    // Copy QR code image
    if SalesHeader.QRCodeImage.HasValue() then begin
        SalesHeader.QRCodeImage.CreateInStream(InStr);
        SalesInvHeader.QRCodeImage.CreateOutStream(OutStr);
        CopyStream(OutStr, InStr);
    end;
 
 
end;
 
2. how we generate qr code image  through TLV string without any external api in business central
I have the same question (0)
  • Suggested answer
    OussamaSabbouh Profile Picture
    12,878 Super User 2026 Season 1 on at
    Hello,
     
    Copying the QR code Blob after posting didn’t work because either the event didn’t fire, the Blob wasn’t loaded, or the value was overwritten later in posting. The reliable approach is to copy the Blob after the Sales Invoice Header is inserted, call CalcFields on the Sales Header Blob, copy the stream, and then Modify the posted invoice header to persist it.
    Generating a QR code from a TLV string without external APIs is supported in BC Cloud by building the TLV, converting it to Base64, and using Business Central’s built-in QR/Barcode generation to create an image stream and store it in a Blob. No .NET or external services are required.
    Regards,
    Oussama Sabbouh
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,128 Super User 2026 Season 1 on at

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,946 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,177 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 555 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans