> For the complete documentation index, see [llms.txt](https://www.neptune.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.neptune.tech/mobile-workspace/mobile-application/real-time-scanning.md).

# Real-time scanning

Scan barcodes into Dynamics 365 with the phone camera — pair the Dynamics Express app with the Scanning pane, scan with quantities, pick a picking list as you scan.

With real-time scanning, the phone camera works as a barcode scanner for Dynamics 365: every barcode you scan in the Dynamics Express app is handled right away in the **Scanning** pane of your Dynamics 365 session — for example to open the product. Real-time scanning does not need a Mobile workspace registration.

## See it in action

A 4.5-minute demo, Dynamics 365 and the phone side by side: a picking list picked as the phone scans (paired by the Scanning pane's QR code, quantities on the keypad, a refusal in red), then [scanning operations](/mobile-workspace/mobile-application/scanning-operations.md): a purchase order sent to a user group and scanned on the phone.

{% embed url="<https://980223628-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBT7AhPDmzqW9GObzesdP%2Fuploads%2Fgit-blob-27a27084328ca905776b1ce4f95f2824d43eedbb%2Frealtime-scanning-demo.mp4?alt=media>" %}
Real-time scanning and scanning operations demo (4.5 min, Full HD)
{% endembed %}

{% file src="/files/EZfZXVg50HXz9gGopwQC" %}
Download the video (MP4, 25 MB)
{% endfile %}

## In Dynamics 365: the Scanning pane

Open the **Scanning** pane from the settings menu (gear icon › **Scanning**). It shows:

* the **context** — the form you are working in,
* **Action** — what to do with a scanned barcode, for example **Open product details**,
* **Real-time scanning** — **Connect** / **Disconnect**, a status line and the pairing QR code,
* **Manual entry** — type a barcode and select **Find**,
* **Import** — a list of barcodes, one per line, **From file** or **From clipboard**,
* **Log** — every barcode handled, with its result.

Everything except **Real-time scanning** (and **Serial port scanning**) is in the Advanced Suite base license — see [Product barcode scanning](/advanced-suite/barcode-management/product-barcode-scanning.md).

## Pair the phone

{% hint style="warning" %}
**License required:** the **Real-time scanning** group of the pane is shown only with the **Scanning - Real-time scanning (users)** license imported (and the configuration key **Scanning › Real-time scanning** on). **Connect** also needs **Real-time scanning** selected for your user in *Advanced parameters › Product and licenses ›* [*User licenses*](/advanced-suite/getting-started/activate-a-license.md#user-licenses); without the check box the status line shows *User … has no Real-time scanning license. Select it for the user in Advanced parameters > Product and licenses > User licenses.*
{% endhint %}

1. In the Scanning pane, select **Connect**. A QR code appears and the status line says *Scan this QR code in the Dynamics Express app: menu › Real-time scanning*.
2. In the app, open the menu (☰) and select **Scanning › Real-time scanning**, then point the camera at the QR code. (On the start page of the app, **Scan QR-code** recognises this QR code too.) Another code is not taken: the app says *This is not the QR code of the Scanning pane*.
3. The app says *Connecting…*, then shows a green **Paired with Dynamics 365** screen for a moment; the QR code disappears in Dynamics 365 and the status line says *Paired — point the phone camera at a barcode.* When the pane doesn't answer within a few seconds, the app says *Dynamics 365 is not connected* and offers **Scan new QR code**.

While paired, **Connect** is disabled and **Disconnect** is enabled.

## Scan

After pairing, the app shows the scanner of [Scanning operations](/mobile-workspace/mobile-application/scanning-operations.md#scan-in-the-app): the camera on the upper half of the screen, **Auto scan** / **Manual scan**, the last barcode with its quantity, a keypad, and the gear at the top right of the camera with **Auto-add**.

* **Manual scan**: point the camera at a barcode and select **Scan**. **Auto scan**: every barcode the camera sees is read, with the **Scanning delay** of [Settings](/mobile-workspace/mobile-application/app-settings.md) between two barcodes; the same barcode again only after it has left the camera's view.
* When a barcode is read, the picture stops, the corners close in on the barcode and highlight it, and the phone beeps (Settings › Scanning › **Beep volume**).
* With **Auto-add** on, the barcode goes to Dynamics 365 right away with the quantity **1**. To change it, type the quantity with the keypad and select **OK**: **5** makes it 5 — the app sends the difference (4), and Dynamics 365 adds it to the same line. With **Auto-add** off, the barcode waits with the quantity **1**: type another quantity if needed and select **OK** to send it, or **0** and **Skip** to leave it out.
* Under the barcode, the app shows what Dynamics 365 did with it — *Sent to Dynamics 365…*, then in green the result, for example *'M0001': 3.00 ea picked on picking list 00136*, or in red the reason it was not handled, for example *'M0001': 5.00 ea scanned, but only 1.00 ea is left to pick on Picking list 00136. Nothing was picked.*, with a low double tone. Dynamics 365 runs the selected **Action** and adds a line to the **Log**.

The quantity is used by the actions that add quantities to lines (below). **Open product details** and **Open sales prices** open the form once per barcode; a quantity changed afterwards changes nothing.

The pairing QR code itself is never sent as a barcode: if the camera sees it again, the app shows *Already paired — point the camera at a product barcode*.

The actions find the product by the Advanced Suite product barcodes, then by the item bar codes of the current company (**Product information management › Products › Item - bar code**).

## Barcode types

The app reads barcodes with [ZXing](https://github.com/zxing-js/library), the open-source barcode library (the JavaScript port of Google's ZXing). It reads:

| 2D                                  | Linear                                                                                        |
| ----------------------------------- | --------------------------------------------------------------------------------------------- |
| QR Code, Data Matrix, Aztec, PDF417 | EAN-13, EAN-8, UPC-A, Code 128 (also GS1-128), Code 39, ITF (Interleaved 2 of 5), GS1 DataBar |

The app tells Dynamics 365 which type it read: it is kept with the log line of the Scanning pane (the hidden **Barcode type** column), and `parmSymbology()` for [actions](/development-tools/scanning/actions.md) of your own.

Not read by the phone: UPC-E, Code 93, Codabar, GS1 DataBar Expanded, MaxiCode. For these, use a barcode scanner ([Serial port scanning](/advanced-suite/barcode-management/product-barcode-scanning.md#serial-port-scanning)).

{% hint style="info" %}
**Third-party components:** ZXing for JavaScript (`@zxing/library`, `@zxing/browser`) is free open-source software — MIT licence for the packages, Apache License 2.0 for the ZXing code they port; both allow commercial use. The app also uses React and React Router (MIT). The licence texts come with the app, in `third-party-licenses.txt` next to it.
{% endhint %}

## Scan items into orders and journals

On a sales order, a purchase order or an inventory journal, the **Action** list has two more actions; on **Picking list registration**, **Pick picking list line**. A barcode entered, pasted or imported in the pane, or read by a serial port scanner, is handled the same way as one scanned with the phone (with the quantity 1).

| Form                                                                                                      | Actions                                                                                                 |
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| **All sales orders**, sales order                                                                         | **Add quantity to sales order line** (default), **Add quantity or create sales order line**             |
| **All purchase orders**, purchase order                                                                   | **Add quantity to purchase order line** (default), **Add quantity or create purchase order line**       |
| Inventory journal lines: **Movement**, **Inventory adjustment** (profit/loss), **Transfer**, **Counting** | **Add quantity to inventory journal line** (default), **Add quantity or create inventory journal line** |
| **Picking list registration**                                                                             | **Pick picking list line** (default) — see [Pick a picking list](#pick-a-picking-list)                  |

How a scan is handled:

* The actions change the document only when the user's security roles allow it on its form. **Add quantity to … line** and **Pick picking list line** need **Update** access, **Add quantity or create … line** needs **Create**. Without these rights, the actions aren't offered and a scan gets the reason in red, for example *Sales order 000886: your security roles don't allow changing its lines.* See [Security](/advanced-suite/barcode-management/product-barcode-scanning.md#security).
* The barcode is an Advanced Suite product barcode or an item bar code of the current company (**Item - bar code**). The quantity scanned is the quantity typed on the phone (1 otherwise) times the quantity of the bar code (1 if it has none). If the bar code has a unit, the quantity is converted to the unit of the line.
* A line matches when it has the same item and the same product dimensions (configuration, size, color, style, version). A variant bar code, for example size S, adds to the size S line only. If several lines match, the first line by line number gets the quantity.
* **Add quantity to … line** changes existing lines only. If there is no matching line, nothing changes and the log says why, for example *Sales order 000886 has no line with product 'A0001'. To create the line, select the action Add quantity or create sales order line*.
* **Add quantity or create … line** creates the line with the quantity when the document has no matching line. The next scans of that item add to the new line. The new line gets the item, the product dimensions of the bar code and the quantity; everything else (site, warehouse, location, unit, price) is defaulted by Dynamics 365 as for a line entered on the form, from the document header or the item.
* **Counting** journals add to **Counted**: the line's on-hand is calculated, and **Quantity** is counted minus on-hand. In the other journals the scan adds to **Quantity**. **Transfer** lines keep the negative quantity, as on the form; set the receiving site, warehouse and location on the line.
* The lines on the form refresh after every scan. The log shows the result with the full product number, for example *'A0001': line 1 created with 1.00 Pcs* or *'D0013 : : S : :': 1.00 ea added to line 2 (now 2.00)*.
* If Dynamics 365 rejects the line, the reason goes to the log, and in real-time scanning the phone shows it in red. For example, a bar code of a product master on an item with variants gives *Inventory dimension Size is a product dimension and must consequently be specified*. An item already in another open counting journal gives *Item … is locked for updates in warehouse … because it is being counted*.
* A quantity lowered on the phone after **Auto-add** (5, then 3) takes the difference off the line. It never creates a line, and Dynamics 365 may refuse it, as on the form (for example when the line is on a picking list).

### Pick a picking list

Open **Inventory management › Outbound orders › Picking list registration** (or **Picking list registration** of a sales order), select the picking list and pair the phone. **Pick picking list line** is selected in the pane: every barcode scanned picks its quantity on the picking list right away, as **Update selected** does for selected lines on the form.

* The open lines (**Activated**, **Started**) of the item with the product dimensions of the barcode are picked in the order of the picking list. A line with more than the scanned quantity is split first, as **Functions › Split** does, and the scanned part is picked; the rest stays on its own line to pick. A quantity larger than a line picks it and goes on with the next line of the item.
* More than is left to pick of the item: nothing is picked, and the phone shows *'M0001': 5.00 ea scanned, but only 1.00 ea is left to pick on Picking list 00136. Nothing was picked.* An item that isn't on the picking list (or is all picked): *Picking list 00136 has no line with product 'A0001' left to pick.*
* With the last line picked, the result says *… - all its lines are picked*; Dynamics 365 completes the picking list as for lines picked on the form.
* A picked quantity is not lowered by scanning: unpick the line on the form (**Functions › Unpick**). Catch weight items are picked on the form.

### For developers: extension points

How the line is found, created and updated can be changed with Chain of Command — see [Order and journal line actions](/development-tools/scanning/order-and-journal-line-actions.md) in the [Scanning framework](/development-tools/scanning.md).

## End the session

* **Disconnect** in the Scanning pane, or close the pane, ends the session; the app shows *Waiting for Dynamics 365…*.
* In the app, **Scan new QR code** returns to the camera to pair with another pane.
* A session that is not used expires; select **Connect** again to get a new QR code.
