Tag Archives: barcodes

Price embedded barcode in AX2012

In this blog we will be discussing how we can configure Price embedded barcode; for this please perform following steps in AX Retail Module:

  1. First configure bar code mask characters in retail (for example: product and price) (retail > setup > mask character)

1 2. Then create a new bar code masks setup selecting Product in type with selection of barcode standard in general tab (for instance code128), in Barcode mask segment add lines with Mask characters of price and product. For prefix using 1, and for length of product and prices using 4 and 6 respectively, and decimal as 2. (Retail > setup > barcode mask setup)

23. Configure a new Barcode setup. Add Barcode setup and description in General tab select Barcode type (using code 128), now select Mask ID from drop down (created in Barcode mask setup)( (retail > setup > barcode mask setup)

34. Now attach this barcode setup to item (item should have selling price). Go to retail tab of product and select created barcode setup.

45. Then create barcode of item in following way; 10000000000. Here 1=Prefix, 0000= Product and 000000= Price. In general tab select unit of measure (using Pcs as example)


General tab select unit of measure


Note: This setup is also applicable for items with weight as if vegetables etc. select Kgs as unit of measure.

In weighing scale when item is weighed it will take weight of item X unit price

In addition, it will print the barcode with net amount of price

Like 10000025000

Here 1 is prefix 0000 is item and 0250 is price

This is what weighing scale will print

Moreover, on POS it will do a backward calculation 250/item price = quantity

  1. Now execute assortments and run jobs

Microsoft Dynamics AX Job – Eliminate Duplicate Barcode issue

I wrote a job that eliminated the duplicates barcode issue in AX 2012. The job goes through the list of the barcodes, finds duplicated barcodes and adds a D and a counter value at their beginning.  Duplicated barcodes, which are renamed after running this job, can always be found easily by getting a list of the barcodes starting with the letter “D”.

I am sharing the code here:

static void EliminateDuplicateBarcodes(Args _args)
    InventItemBarcode inventItemBarcode,inventItemBarcode1;
    int counter;


    while select itemBarCode,RecId from inventItemBarcode where inventItemBarcode.itemBarCode != ''
        while select forUpdate itemBarCode,recid from inventItemBarcode1
            where inventItemBarcode1.itemBarCode == inventItemBarcode.itemBarCode
                && inventItemBarcode1.RecId != inventItemBarcode.RecId
            inventItemBarcode1.itemBarCode = strFmt("D%1-%2",counter,inventItemBarcode1.itemBarCode);




Happy Coding :)