community postSales & Receivablescommunity - not Microsoftreviewed - checked by Opus

Dynamics 365 Business Central: Add a Scan Barcode action and scan multiple/Continious scanning (Invoke barcode scanning programmatically from AL)

Business Central version 24 introduced barcode scanning APIs using control add-ins to replace .NET-based APIs, enabling developers to add scan actions and continuous scanning to custom pages via the CameraBarcodeScannerProviderAddIn control add-in.

post Dynamics 365 Lab

Yun Zhu · 2026-01-15 · 1,312 words · about 6 min

"Version 24 introduced barcode scanning APIs based on control add-ins to replace the .NET-based APIs."

Key points

  • Setting ExtendedDatatype to Barcode on a table or page field shows a scan button in the mobile app.
  • From version 24, the CameraBarcodeScannerProviderAddIn control add-in replaces the .NET barcode APIs, which were on-premises only, for custom scan actions.
  • Call RequestBarcodeAsync from an action and handle the ControlAddInReady, BarcodeAvailable and BarcodeFailure triggers.
  • Calling RequestBarcodeAsync again inside BarcodeAvailable turns on continuous scanning.
  • Example: a Sales Order action scans Lot No. barcodes and adds the matching item as sales lines.

Quotes

  • “Version 24 introduced barcode scanning APIs based on control add-ins to replace the .NET-based APIs.” (Marks the shift to the recommended approach for implementing barcode scanning in custom extensions)
  • “This means we can add scan barcode actions and multiple scanning functions to our own extensions.” (Enables developers to create custom barcode scanning capabilities beyond standard Business Central functionality)
  • “Enabling multiple scans is also very simple; just remove the comments from step 5 in the sample.” (Shows that continuous scanning requires minimal code changes, making it practical for real-world scenarios)

AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

No source states these links: they share an object, a model read them, or a person found the same subject.

Heads up

  • gotcha: “Sometimes it displays the previous result, I’m not sure if it’s a bug.” (about other CameraBarcodeScannerProviderAddIn, BarcodeAvailable)

Context

  • Features: Barcode scanning via camera, Control add-in based APIs, Continuous scanning, Mobile app barcode support, RequestBarcodeAsync method, ControlAddInReady event, BarcodeAvailable event
  • Versions: 2023 wave 2, 24

Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.