Warehouse Mobile device portal: Simple Barcode scanning (x++ Customization)


Recently I have came across a scenario; where client wants to search a barcode consist of Item+ Batch

Which was apparently a masked barcode i.e so we have item text field and a batch text field on the page, So client wants to use the same barcode value to be scanned twice for batch and item and appropriate value should be shown.




To cater this scenario I have researched and gone through very interesting and comprehensive blogs , mainly this one

Link: http://blogs.msdn.com/b/dynamicsaxscm/archive/2015/04/29/barcode-scanning-in-the-mobile-device.aspx

But inseated of creating new processor class, I have updated the existing process class i.e.



First assuming the barcode has been setup for the item like below: i.e. Item+batch



First I added a new parmMethod for batch Id, for Item; parm method already exist in the class

‘InventInventItemSearchResult’. This is a small class that is returned from the search framework when matching data is found. Currently this class contains the following fields:

  • ItemId
    • Always filled in by the SearchProcessors when a matching item is found within AX
  • InventDimId
    • Filled in when a matching variant is found for a GTIN/Barcode lookup
  • UnitOfMeasureSymbol
    • Filled in when a matching variant is found for a GTIN lookup

So for batch data to be returned also, this class needs to added the parm method for batch.i.e

public InventBatchId parmBatchId(InventBatchId _batchId = batchId)


batchId = _batchId;

return batchId;


Once it is done, ‘newFromParams’ method of the same class need to be updated, which

Construct a <c>InventInventItemSearchResult</c> object based on the passed in data.


Coming back to the ‘InventInventItemSearchBarcode’’ class I have updated the ‘search’ method as below for batch id,

The code inventItemBarcode.invetDim().inventBatchId retrieves the batch id value stores in the inventitembarcode table. In the barcode setup of the form


This is the customized field ‘Batch number’ which I have added to this bar code form for the specific item.

Code in the ‘InventInventItemSearchBarcode’ class


Now the last part is the update in the ‘WHSRFControl Data’ class

WHSRFControlData::processData method the code calls WHSRFControlData::processControl for each of the controls on a form. This method contains specific processing logic for each of the different fields defined in the system. This enables common and consistent processing of fields by the framework each time they are used .

So here our code will be update for process Control method only.


That’s all for the code customization.

Let see now how it is working

  • I create a purchase order with the item ‘000147_202’ and confirm that
  • I logged in the portal
  • Enter the work user and go to inbound port
  • Then PO Receipt, like


  • Then enter the Item number barcode which is basically the masked barcode i.e 000147_2021234


As soon I enter and press ok, this barcode get processed and correct item has been fetched and shown on the page and relevant information has also been retrieved


Similary for Batch Id for different item i.e 000160_2021234


Releavant Batch number has been fetch.


Note: For Batch number field to be available for the specific item number,

Storage dimension group, Tracking dimension group needs to be set.



And thats it, Hope it may help.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s