Thursday, August 5, 2010

Creating New Inventory Dimension - Storage

AX has 8 standard inventory dimension here is the classification of these 8 dimensions

Inventory Item Dimensions
  1. Size
  2. Colour
  3. Configuration
Inventory Storage Dimensions
  1. Batch
  2. Serial
  3. Warehouse
  4. Location
  5. Pallet
Below is the list of objects that needs to be created or modified while creating a new inventory storage dimension. Please note that the list is not exhaustive enough but contains most of the objects that needs to be modified. Let us assume the name of the new dimension would be 'Test'
xtended Data Types


Following is the table specifying the EDTs that one may need to create for new storage dimension. Reference EDT section specifies which EDT to look at while creating new EDT.

EDT Name = InventTestId
Label = Test
Extends = SysGroup
Type = String
Reference EDT = InventLocationId

Tables

New table 'InventTest' : Look at the table InventLocation for reference and create a new table InventTest. Do not forget to create the field groups, indexes, properties similar to InventLocation. You can duplicate this table and change the required fields, methods, fields groups, indexes, propeties etc.

Table InventParameters : A new method 'numRefInventTestId' needs to be created. Take method 'numRefInventSerialId' for an example while creating this method.

Table InventDim : You will have to create a new field 'InventTestId'. Add this field to field groups, 'AutoReport', 'InventoryDimensions'. Create a new index 'TestIdx' with this field, Add this field InvenyTesId to index 'DimIdx'. Modify the following methods, take cue from code for other dimensions and add the relevant code. Methods are: 'dim2dimParm', 'dimParm2dim', 'emptyDimField', 'findDim', 'findOrCreate', 'formQueryAddDynaLink', 'isFieldIdItemDim', 'isFieldIdTransferReceiptMergable', 'isFieldIdTransferTransitReceiptMergable'.

Table InventDimParm : Add a new field 'InventTestIdFlag'. Add this field to following field groups: 'AutoReport', 'Fixedview', 'View'.

Table InventSum : Add a new method named 'inventTestId'. Take cues from 'inventSerialId' method in the table.

Table InventSumDateTrans : You will have to create a new field 'InventTestId'. Add this field to field groups, 'AutoReport', 'InventoryDimension'. Modify following methods: 'initFromInventDim', 'inventDim'.

Table InventSumDeltaDim : You will have to create two new fields named 'InventTestId', 'InventTestIdFlag'. Add the 'InventTestId' field to following groups : 'AutoLookup', 'InventDim'. Add 'InventTestIdFlag' field to following groups: 'InventDimFlags'. Modify following methods: 'initFromInventDim', 'initFromInventDimParm', 'initInventDim', 'initInventDimParm'.

Table InterCompanyInventDim : You will have to create a new field 'InventTestId'. Add this field to field groups: 'AutoReport', 'InventoryDimensions', 'TmpInventDimensions'. Add the field to following indexes: 'DimIdx'. Modify following methods: 'fromInventDim', 'toInventDim', 'dim2dimParm', 'dimParm2dim', 'formQueryAddLink'.

Table PBATreeInventDim : You will have to create two new fields named 'InventTestId', 'InventTestIdVar'. Add the 'InventTestId' field to following groups : 'AutoReport', 'AllFields', 'InventoryDimensions'. Add 'InventTestIdVar' field to following field group: 'InventoryDimensions'. Add a new method named 'inventTestId'. Take cues from 'inventSerialId' method in the table.
 
Macros

Following is the list of macros that may need to be modified  
  1. InventDimSelect 
  2. InventDimJoin 
  3. InventDimGroupAllFields 
  4. InventDimExistsJoin

 Classes 

  
New class AxInventTest : Run the class AxGenerateAxBC and select the table InventTest. This will create new AxBC class for InventTest table and you will have to resolve some errors.

Class NumberSeqReference_Inventory : The method 'loadModule' has to be modified to create a reference for 'Test'.

Class InventDimRenameValue : Add a method 'newInventTest'. Take cue from method 'newInventSerial' for definition of this new method.

Class InventDimTracking : Modify method 'initFromArgs'. Take an example of any of the inventory dimensions for changes.

Class AxInventDim : Add parm and set methods for InventTestId field. Take example of parmInventSerialId and setInventSerialId. Modify method setTableFields to make a call to setInventTestId method.

AxInventDim_PriceDiscTable : Add method setInventTestId. Take example of setInventSerialId for definition of this method.

Class InventDimFixedClass : Add following methods : 'parmInventTestIdFlag' - Take example from parmInventSerialIdFlag method and 'inventTestIdFlag' - Take example from inventSerialId flag method. Create a macro for InventTestId in ClassDeclaration (look at declarations for other dimensions). Modify method 'fieldId2Idx'.

Class TradeInterCompany : Modify method 'createTmpInventSum'.

Class PBALib : Modify method 'createInventDim'.

Apart from these classes there are many more classes that may need modifications like InventMovement, InventUpd and its child classes. InventOnhand and related classes etc. If you want to know more you can search for keyword 'InventSerial' in the classes node and find out.

  
Forms

   
Following new forms need to be created

InventTest : Similar to InventSerial.
InvenTestIdLookup : Similar to InventSerialIdLookup

3 comments:

Joe Robinson said...

Afsar, Thanks for the walk-through for making this type of modification.

I've also learned that if you search for the Macro #InventDimDevelop you should find many of the places that need to be modified when adding a dimension.

Since posting this topic, do you have any additional tips to share for undergoing such a change?

Afsar said...

You can add new dimension easily by just searching the MACRO, but be sure for testing, i missed some places where code should be written, in my general opinion, you have to search the macro in AOT and made your expected changes over there.

Abubaker Shekhani said...

Hi,

You've created a new type of storage dimension group. Can we create a new dimension group for Item Dimension?

Like we have Size, Color, Configuration. Can we had a fourth and fifth one like Model No., Brand etc?