AX has 8 standard inventory dimension here is the classification of these 8 dimensions
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’
Extended 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.
- 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.
Following is the list of macros that may need to be modified
- 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.
Following new forms need to be created
- InventTest : Similar to InventSerial.
- InvenTestIdLookup : Similar to InventSerialIdLookup
InventTest screen shots
Create one display type menu item for InventTest form, similar to InventSerial Menu Item.
Note: There are more objects that can be modified. Also you will have to create a link to open the main form for the dimension at correct place in the correct menu as required.
One more important point that i would like to add if you want to know where all in the application an inventory dimension is having a impact then do a search on entire AOT for Macro #InventDimDevelop. This macro has been included in all the places which are directly impacted by inventory dimensions. Nice way to know the critical objects and take care of them
Below is the link to sample project that contains a sample for new inventory storage dimension.