import { Callout } from "zudoku/ui/Callout";

# 365 business Barcode

`365 business Barcode` encodes values as barcode images and reads barcodes back out of images, in Microsoft Dynamics 365 Business Central. Eighteen symbologies are supported, from `Code 128` and `EAN-13` to `QR Code`, `Data Matrix` and `PDF417`.

This page is the entry point for using the app from your own extension.

| You want to | Start here |
| --- | --- |
| Generate or read a barcode from your own code | [Barcode](barcode.mdx) |
| Move code off the predecessor codeunit | [Barcode API (obsolete)](barcode-api.mdx) |

## Dependency

Add a dependency to the `365 business Barcode` app in the `dependencies` node of your `app.json`:

```json
    {
      "id": "9aca19d9-d261-4fa0-88fd-121ad0daa0f7",
      "name": "365 business Barcode",
      "publisher": "365 business development",
      "version": "18.2.0.0"
    }
```

<Callout type="info" title="Which version you need">
The `bdev.Barcode` codeunit has been introduced with **18.2**, which replaced the former `bdev.Barcode API`. On an older version only [bdev.Barcode API](barcode-api.mdx) is available.
</Callout>

## The public objects

The objects below are the supported surface of the app. Everything else is `Access = Internal` or an implementation detail that may change without notice, even where AL leaves it public.

| Object | Type | What it is for |
| --- | --- | --- |
| `bdev.Barcode` | Codeunit (`5523960`) | [Encode and decode barcodes](barcode.mdx), and encode a contact as a vCard barcode. |
| `bdev.Barcode Settings` | Table (`5523582`) | A named set of barcode properties: symbology, colors, height, margin, whether the value is printed below the code, and the symbology-specific options. Maintained by the user in `Barcode Settings`. |
| `bdev.Barcode Symbology` | Enum (`5523582`), not extensible | The supported symbologies. |
| `bdev.Barcode` | Table (`5523583`), temporary | The settings of a single barcode, without a `Barcode Settings` record behind them. |
| `bdev.Barcode API` | Codeunit (`5523581`) | The predecessor of `bdev.Barcode`. [Obsolete since 18.2](barcode-api.mdx). |

## Supported symbologies

| Value | Symbology | | Value | Symbology |
| --- | --- | --- | --- | --- |
| `0` | Aztec Barcode | | `9` | MSI |
| `1` | CODABAR | | `10` | PDF417 |
| `2` | Code 39 | | `11` | Plessey |
| `3` | Code 93 | | `12` | QR Code |
| `4` | Code 128 | | `13` | UPC-A |
| `5` | Data Matrix | | `14` | UPC-E |
| `6` | EAN-8 | | `15` | ITF-14 (SCC-14) |
| `7` | EAN-13 | | `112` | vCard QR Code |
| `8` | ITF (Interleaved Two of Five) | | | |

<Callout type="caution" title="Not every symbology can do both">
Each symbology states for itself whether encoding and decoding are supported, and which of the `Barcode Settings` properties it accepts - a QR code has an error correction level, a linear code has a height. Setting a property the symbology does not accept has no effect. The `Barcode Settings` page shows only the properties of the chosen symbology, which is the quickest way to find out what applies.
</Callout>

The enum is **not extensible**: a symbology of your own cannot be added, because the encoding happens in the `365 business` service rather than in AL.

## No extensibility events

The app publishes no events. It is a library you call, not a process you take part in - there is nothing in it that happens on its own and could be intercepted.

## Expect the service and the license

Encoding and decoding are performed by the `365 business` Barcode service over HTTP. A call fails when the feature is not licensed for the tenant, or when outgoing HTTP calls are not allowed for the app - off by default in a sandbox.

## See also

- [Barcode](barcode.mdx)
- [Barcode API (obsolete)](barcode-api.mdx)
- [Documentation - 365 business Barcode](../../en-us/365-business-barcode/index.mdx)
