2 December 2014

How to use Data Migration Studio to import category hierarchies

How to use Data Migration Studio to import category hierarchies—the easy way

How to use Data Migration Studio to import category hierarchies—the easy way

Today, I will show you how to import category hierarchies by using To-Increase Data Migration Studio for Microsoft Dynamics AX 2012. Category hierarchies can be extremely helpful when you want to organize products and for procurement. For example, you can order office supplies in the category ‘office supplies’ without creating a product in the database. With Data Migration Studio, the import tasks is quite simple.

The retail category hierarchy is particularly interesting. By using retail categories you can maintain product attributes and properties at the category level.

Now, with a good sense of what category hierarchies are about, let’s dig into the tables. The table below lists the tables which are required to import the category hierarchies.

Table Description
InventTable This table includes the released product information. In this tutorial we are using the InventTable to lookup the product RecId which is used for the relation between the EcoResProductCategory.
EcoResProductCategory This table is a cross reference table between the products and the categories.
EcoResCategoryHierarchy This table is the hierarchy you are using during the import. In this tutorial we are assuming that the hierarchy exists. Thus, we are only looking for the provided hierarchy. If the hierarchy not exists the import throws an error.
EcoResCategory This table is the actual category.
EcoResCategoryTranslation This table is a translation for each category.

The diagram below gives insight in the relations between the above-mentioned tables.

Import Category Hierarchies 1

The migration in Data Migration Studio works as follows:

  1. Lookup the category hierarchy in EcoResCategoryHierarchy
  2. Lookup the parent product category in the EcoResCategory
  3. Update or insert the category in EcoResCategory
  4. Update or insert the translations in EcoResCategoryTranslation
  5. Lookup the product in the InventTable
  6. Update or insert the EcoResProductCategory

Ready to get practical? Download our .rar package and follow the next steps to configure:

  1. Import the included xpo, which includes a new entity BisEcoResCategory. This entity calculates the level and the nestedsetleft and nestedsetright.
  2. Import the migration ‘Items - Category, Text.xml’. This is the actual migration to import the product categories.
  3. Run the migration ‘Items – Category’ and select the tutorial file ‘Item_category.txt’. Please note that you have to adjust the information in the file according your Microsoft Dynamics AX 2012 environment.

For more background information on categories, do contact us.

Talk to our expert to know more about Data Migration Studio

Pieter de Jong,
Pieter de Jong,
Technical Solution Architect

Also interesting

To-Increase Net Zero Website Tree-Nation