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

Scenario:

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.

 

 

Resolution:

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.

InventInventItemSearchBarcode’

 

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

(000147_202)(1234)

MaskedBarcode

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.

newFromParam

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

BatchId

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

Searchmethod

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.

BatcHId1

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

POReceipt1

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

PORecient_ItemNumber

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

PoRecient_CorrectItemNumerFeatched

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

BactchIDFOrDifferentItem

Releavant Batch number has been fetch.

CorectBatchIdBeenFetched

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

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

TrackingDimension

StorageDimension

And thats it, Hope it may help.

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s