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

Copy qrcodeimage from salesheader to salesinvoiceheader

(3) ShareShare
ReportReport
Posted on by 275
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
    6,321 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

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,362

#2
YUN ZHU Profile Picture

YUN ZHU 867 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 607

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans