Security change on December 1, 2026: TLS 1.2 will become the minimum standard for 365 business Print Agent. Details and system requirements
365 business development
365 business Barcode

Barcode API (obsolete)

Codeunit 5523581 bdev.Barcode API was the entry point of the app before version 18.2. It has been replaced by bdev.Barcode and is obsolete since then.

Code
ObsoleteState = Pending; ObsoleteReason = 'Replaced by "bdev.Barcode".'; ObsoleteTag = '18.2';

Do not write new code against this codeunit

ObsoleteState = Pending means the codeunit still compiles, with a warning. It will be removed in a future major version, and so will the bdev.Barcode Format enum and the bdev.Barcode Defintion table it works with.

What to use instead

bdev.Barcode APIReplacement
Encode(Codeunit, Text, Enum "bdev.Barcode Format") and its four longer overloads with height, width, margin and includeTextbdev.Barcode.Encode(Enum "bdev.Barcode Symbology", Text) for the defaults, or Encode(Record "bdev.Barcode Settings", Text) where the appearance matters
Encode(Codeunit, Text, Code[20]) and Encode(Codeunit, Text, Record "bdev.Barcode Defintion")bdev.Barcode.Encode(Record "bdev.Barcode Settings", Text)
Decode(Codeunit, var Text)bdev.Barcode.Decode(Codeunit), which returns the value instead of writing it to a var parameter
HideValidationDialog(Boolean)No replacement, and none needed - the new codeunit shows no dialog
BarcodeFormatToBarcodeSymbology(Enum)Only useful while migrating, see below

Moving code over

Two things change beyond the codeunit name.

The result is returned, not filled in. The old methods took the Temp Blob as a var parameter, the new ones return it:

Code
// before barcodeApi.Encode(image, item."No.", format::QR_CODE); // after image := barcode.Encode(Enum::"bdev.Barcode Symbology"::"QR Code", item."No.");

Appearance moves into a record. Height, width, margin and "print the value below the code" were parameters; they are fields of bdev.Barcode Settings now. A call that passed them becomes a settings record - stored, when the appearance is a setup decision, or initialized in memory when it is not.

The format enum becomes a symbology enum. bdev.Barcode Format is replaced by bdev.Barcode Symbology. While migrating, BarcodeFormatToBarcodeSymbology translates a stored format value into the new enum, so that data written by an older version can be read:

Code
barcodeSettings."Barcode Symbology" := barcodeApi.BarcodeFormatToBarcodeSymbology(mySetup."Barcode Format");

Once your setup stores the symbology, drop the call - it is obsolete along with the rest of the codeunit.

See also

Last modified on