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

Barcode Storage in Table

(0) ShareShare
ReportReport
Posted on by 106

Can I store the BarCOde string as an image in the Blob field for every item, it is to be done on table level, not on reports?

Suggested video from Erik Hougaard converts the value in 0 and 1 format which is not expected value. Barcode is made up with the combination of Item no+qty+UOM for every entry.

with the native report of BarCode we can easily print on the report, but how can I store it in a blob

as the BarCode image has to be sent to the third part as a Base64 string.

I referred to this code and further added a table to store input

https://yzhums.com/11763/

https://robertostefanettinavblog.com/2021/04/07/barcode-in-business-central-cloud/

after using above mentioned function,ignore codabara only used 

 GenerateCode128();
        GenerateCode39();
        GenerateCode93();
as some other functions have error now

it is a sample written to store data

        /
    local procedure InsertValues(itemno: Code[20]; Input: text; BarCodeSymbology: Enum "Barcode Symbology")
    var
        ItemBarcode: Record "Bar Code Table";
        Base64: Codeunit "Base64 Convert";
        oStream: OutStream;
        istream: InStream;

    begin
        ItemBarcode.Init();
        ItemBarcode.BarCodeText := itemno;
      
        ItemBarcode.Image.CreateOutStream(oStream);

        oStream.WriteText(Input);
        ItemBarcode.Image.CreateInStream(istream);

        CopyStream(oStream, istream);
        ItemBarcode.Symbols := BarCodeSymbology;
        ItemBarcode.Insert();
    end;
I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    If you are on latest version of BC you don't need any third party websites or code to generate code, you can use standard BC, please see below

    docs.microsoft.com/.../devenv-report-add-barcodes

    and you can store that encoded text in the standard field.

  • Techworld Profile Picture
    106 on at

    For this I wrote that local procedure InsertValues() but I am not able to convert that in image, it is corrupting image. Is there a way I can store an image or generate value as Barcode looks

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Check this repository, you need to use an API to generate and store in table as Blob

    github.com/.../Cod50121.GenerateBarcode.al

  • Techworld Profile Picture
    106 on at

    yes, this was the way people used to do for QRCode and BarCode as third party BarCode4me has stopped there services, many others have come in market with their third party APIs for use.

    some are paid and some has some limitations above which they are paid.

    Actually, I was looking for if new BarCode support introduced in Business central  encoded value can be stored as an image like a BarCode.

    So it can be send as Base64 string to third party system

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 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans