Item Barcode Rules

Skip to main content

Item Barcode Rules

You are here:

Item Barcode Rules

Depending on your environment, you may have a mix of barcodes and data formats. To handle this requirement, the application uses the Barcode Rules page. Barcode Rules allow you to configure the logic used to decode each barcode data to correctly return the various pieces of information.

By default, the installation process preloads common rules. Review the rules provided and disable any that do not pertain to your organizational needs.

Configuring the Item Barcode Rules to correctly interpret/parse a barcode requires a knowledge of Regular Expression syntax. For more information on Regular Expression syntax, see Microsoft's Regular Expression Language – Quick Reference page or find an online Regular Expression tutorial for additional help.

Barcode Rules break out into the following pieces:

  • Run Order: Use this to indicate the order rules are processed in. If a successful match is made, no further rules are processed. Your common rules should come first to avoid unnecessary processing.
  • Find Text: This is the regular expression string used to parse the barcode data (e.g., 01(.*)17([0-9])10(.*) ).
  • Expression Groups: For each group matched by the regular expression, use $1, $2, and $3 in the Expressions to set the appropriate value.

Barcode rules can be used to capture/interpret the following information:

  • Item No.
  • Item No. 2: Used to find the Item No. if not already part of the barcode.
  • Variant Code
  • Serial No.: Used to find the Item No. if not already part of the barcode.
  • Lot No.: Used to find the Item No. if not already part of the barcode.
  • Expiry Date
  • Cross Reference No.: Used to find the Item No. if not already part of the barcode.
  • Item Identifier: Used to find the Item No. if not already part of the barcode.
  • Item Reference No.: Used to find the Item No. if not already part of the barcode.
  • Unit of Measure
  • Quantity

If the regular expressions are not sufficient (e.g., referencing additional tables), AL code can be written by subscribing to the appropriate events.

The data parsed by the rule is sent back to the devices and is used (if possible) to help minimize data entry or to take additional action.

For example, a barcode in the format [Item Number] [LotNumber] with a physical scan of 80216-T LOT123. Scanning the item during shipping selects the correct line and causes the quantity dialog to appear with the lot number entry prefilled with LOT123.

The same scenario with a barcode format of [Item Number] with a physical scan of 80216-T selects the correct line, but when the quantity dialog is displayed, has the lot number entry blank requiring the user to type in the correct value manually.

For assistance interpreting or creating Item Barcode Rules, contact Support.

Example: Creating a Barcode Rule

Creating a Barcode Rule shows you how to define and configure a sample barcode rule. The goal is to create a rule that can parse a barcode that has Item, Variant Code, and Quantity in the barcode data.

  1. Open the Barcode Rules page in Business Central.
  2. Create a new line.
  3. Set the following fields:
    1. Run Order: “70” (The order the rule is processed with lower numbers first, and if a match is found, no other rules are looked at.)
    2. Find Text: “(.*)/(.*)/(.*)” (The regular expression we use to parse our barcode data with. In this example, we have three groups separated by a “/”.)
    3. Description: “Item + Variant + Quantity” (Can be anything and is used to quickly inform others what the rule is looking for.)
    4. Enabled: “Checked” (If the rule is disabled, it is not processed by the system.)
    5. Item No. Expression: “$1” (The first group result is put into the “Item No. Result” when the barcode is processed.)
    6. Variant Expression: “$2” (The second group result is put into the “Variant Result” when the barcode is processed.)
    7. Quantity Expression: “$3” (The third group result is put into the “Quantity Result”.)
  4. Type “1896-S/blue/10” and press Test All Rules.
Was this article helpful?
2.9 out Of 5 Stars

7 ratings

5 Stars 43%
4 Stars 14%
3 Stars 0%
2 Stars 0%
1 Stars 43%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Need help?

Leave A Comment

Table of Contents
Go to Top