You are on page 1of 9

Microsoft Dynamics AX

®

Import commodity codes into a category hierarchy
White Paper This white paper describes how to create and use an XML file to import commodity codes from an external classification system into a product category hierarchy in Microsoft Dynamics AX.

Donna Daem September 2013 http://go.microsoft.com/fwlink/?LinkID=313695&clcid=0x409

.... 5 Import the commodity codes ...... 3 Prerequisites .............. 3 Prepare the XML file for import ........................................................................................ 4 Use Excel to create the XML import file ...........Table of Contents Overview and definitions ....................................................................................................................................... 8 2 IMPORT COMMODITY CODES INTO A CATEGORY HIERARCHY .......................................................................................................

This white paper specifically describes how to import commodity codes from an XML file by using the Application Integration Framework (AIF) service in AX 2012. The first category that is created is automatically assigned as the top level in the hierarchy. NAICS. UNSPSC. An integration port must be set up by using AIF. For more information. A sample XML schema is also provided. see Key tasks: Set up a category hierarchy. There are a several methods available in AX 2012 that you can use to import commodity codes. you can use category hierarchies to classify products or transactions for reporting and analysis. There are several industry-standard classification systems and commodity code systems for reporting to government agencies and industry organizations. the category that you want to use as the parent for the imported commodity codes must be assigned a code number. For example. 3. For information about how to set up an integration port for the category import service. eOTD. 2. A category manager must create a category hierarchy and add at least one category to the hierarchy. depend on the reporting needs of your organization. The process that is described in this white paper uses an XML file format and a schema that maps to specific fields and tables in the category hierarchy features. see Walkthrough: Configuring an inbound integration port for category hierarchies. Only users who are assigned to the System Administrator role can configure integration ports. You can import all or part of an external classification system into AX 2012 to create or update a category hierarchy. In the Category hierarchy form. the code number of the parent category is assigned to all the commodity codes in the import file. and another category hierarchy for products that it sells. To use the AIF service. 3 IMPORT COMMODITY CODES INTO A CATEGORY HIERARCHY . and NIGP. the following tasks must be completed: 1. An organization can create more than one category hierarchy. The number of category hierarchies that your organization uses. Some of these classification systems are available for download to a Microsoft Excel file or other file type from the website of the applicable government or industry organization. the contents of the import file must conform to an acceptable format for the tables in Microsoft Dynamics AX. Prerequisites Before you can import an external classification system to a category hierarchy in AX 2012. When you create an XML import file. This first category is the parent of all other categories in the hierarchy. Some of the more common examples are Intrastat. and the structure and number of subcategories in each category hierarchy. eCl@ss.Overview and definitions In Microsoft Dynamics AX 2012. your organization might create one category hierarchy to classify products that it buys.

Between the <DocPurpose> and </DocPurpose> tags. The indentation at the beginning of each row must be exactly as it is displayed here. 5. enter the company code for the legal entity that uses this category hierarchy. This number might already be assigned by an external classification system. 6. you must add specific XML tags to enable the import into AX 2012. enter a company code for any one of your legal entities. If all legal entities use it. and then repeat steps 4 through 6 for the new commodity code. Between the <SenderId> and </SenderId> tags.Prepare the XML file for import Some standard classification systems can be downloaded from the website of the applicable industry organization or government agency. To add another commodity code. If the information is downloaded to an Excel file. Between the <Code> and </Code> tags. The following procedure describes how to create an XML schema that is valid for importing data into a category hierarchy in AX 2012. This is the code number of the parent category in the category hierarchy. Between the <Name> and </Name> tags. Insert the following XML heading and tags at the beginning of the file. This name might already be assigned by an external classification system. Enter Updated if you are modifying an existing category hierarchy. enter one of the following:   Enter Original if you are importing commodity codes into a new category hierarchy. enter the identification number for a commodity code. <?xml version="1.com/dynamics/2008/01/documents/EcoResCategoryDoc"> <DocPurpose></DocPurpose> <SenderId></SenderId> <EcoResCategoryData class="entity"> <Code></Code> <Name></Name> <Parent></Parent> </EcoResCategoryData> </EcoResCategoryDoc> 2. If the information is already available in an XML file format.0" encoding="utf-8"?> <EcoResCategoryDoc xmlns="http://schemas. you must convert the information to an XML schema that is valid for AX 2012. 7. 4. insert the following lines of tags just before the line that contains the </EcoResCategoryDoc> tag.microsoft. Between the <Parent> and </Parent> tags. enter the identification number for the parent node of the commodity code. 1. enter the name for a commodity code. <EcoResCategoryData class="entity"> <Code></Code> <Name></Name> <Parent></Parent> </EcoResCategoryData> 4 IMPORT COMMODITY CODES INTO A CATEGORY HIERARCHY . 3.

The commodity codes numbers are 10001. in the first four rows of column D. enter the following tags for the first commodity code. 10003. Each of the following lines must be a new row in the workbook. enter the following XML heading tags. 10004. This procedure uses features that are available in Excel.microsoft. Five commodity codes are ready to be imported into parent category 999999. 10002. If you want to import a large number of commodity codes. Row 5 6 7 8 9 Column A <EcoResCategoryData class=“entity”> <Code> <Name> <Parent> </EcoResCategoryData> Column B ##### NNNNN PPPPPP Column C </Code> </Name> </Parent> 5 IMPORT COMMODITY CODES INTO A CATEGORY HIERARCHY .0" encoding="utf-8"?> <EcoResCategoryDoc xmlns="http://schemas. 1. Use Excel to create the XML import file If the list of commodity codes is stored in an Excel file.The following image shows an example of a valid XML schema. <?xml version="1. CategoryB. In this example. and the legal entity is named DAT. and 10005.com/dynamics/2008/01/documents/EcoResCategoryDoc"> <DocPurpose></DocPurpose> <SenderId></SenderId> 2. we recommend that you work with a system administrator to create an XML file by using an automated process. The five commodity codes are named CategoryA. Beginning in the fifth row. and CategoryE. CategoryD. respectively. Use this procedure if you want to import a small number of commodity codes. in columns A through C. you can convert the information to an XML schema that is valid for AX 2012. The indentation at the beginning of each row must be exactly as it is displayed here. CategoryC. In a new Excel workbook. the category hierarchy parent code number is 999999.

In column B. For example. Replace “#####” with the assigned code number for the commodity code. 3. the information for commodity code 10001 in step 2 has been concatenated into column D. Replace “PPPPPP” with the code number of the parent category of the commodity code. use the concatenate formula in Excel to merge the XML tags and the data into one cell. 2. copy the five rows of tags in columns A and C to an additional five-row set. Row 5 6 7 8 9 Column D <EcoResCategoryData class=“entity”> <Code>10004</Code> <Name>CategoryA</Name> <Parent>999999</Parent> </EcoResCategoryData> 6 IMPORT COMMODITY CODES INTO A CATEGORY HIERARCHY . 4. For each additional commodity code that you want to import. replace the placeholders that are used in the table as follows: 1. The following image shows an example of the XML information in Excel. in the following table. After you have entered the commodity code information. 3. In this example. Replace “NNNNN” with the name of the commodity code. five commodity codes are ready to be imported into a parent category that is assigned code number 999999. Then add the information for the commodity code as in step 2.

Enter a name for the file. the sample file is ready to be converted to an XML file. open a new text file. 7. 8. and then press Ctrl+C to copy the information.5. In Notepad or another text editor. enter </EcoResCategoryDoc> as the closing tag on the last row of the worksheet. Select all the information in the concatenated column. In the Save as type field. In the following image. Paste the copied information into the text file. 6. Click File > Save As. After the last row of tags for the final commodity code. and then select a location for this file. This tag signifies the end of the XML schema. select Text (Tab delimited). 7 IMPORT COMMODITY CODES INTO A CATEGORY HIERARCHY .

3. click Product information management > Setup > Categories > Category hierarchies. 2. enter the path of the folder where the XML import file is located. 7. and then click Open.Import the commodity codes Use the following procedure to import the commodity codes in the XML file into a category hierarchy in Microsoft Dynamics AX. In the Import categories form. click Import. In Microsoft Dynamics AX. You receive a message that indicates that the process might take a few minutes. If you are uncertain about the name of the port. click the folder icon. Select a category hierarchy to import the commodity codes into. or create a new category hierarchy. In the File name field. in the left pane. see Key tasks: Set up a category hierarchy. contact a system administrator. 6. For more information. in the Inbound port field. select the integration port that was created for commodity code imports. 4. In the Import categories form. 8 IMPORT COMMODITY CODES INTO A CATEGORY HIERARCHY . In the Category hierarchy form. 5. verify that the tags and indentations in the XML file are valid. 1. see Import categories (form). correct any issues in the XML file. you receive a message that lists the number of commodity codes that were imported. click Categories from file. select the category that is the parent of the commodity codes to import. If no commodity codes were imported. For example. To browse to the location. When the import is completed. In the Select a category file to import form. For more information about how to create a category hierarchy. select the file. On the Action Pane.

domain names. person. it should not be interpreted to be a commitment on the part of Microsoft. or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft. Because Microsoft must respond to changing market conditions. Without limiting the rights under copyright. products. and Canada Toll Free 1-888-477-7989 Worldwide +1-701-281-6500 www. and Excel are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. copyrights. logos. e-mail addresses. Microsoft makes no warranties. Microsoft Dynamics. Complying with all applicable copyright laws is the responsibility of the user. without the express written permission of Microsoft Corporation. or for any purpose. This white paper is for informational purposes only. photocopying. mechanical.S. Microsoft Dynamics works like and with familiar Microsoft software. U. and events depicted herein are fictitious. places. or otherwise). or transmitted in any form or by any means (electronic. or other intellectual property. Microsoft may have patents. organizations. recording. copyrights. or event is intended or should be inferred. the furnishing of this document does not give you any license to these patents. The example companies. place. domain name. adaptable business management solutions that enables you and your people to make business decisions with greater confidence. express or implied. or introduced into a retrieval system. in this document. and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. No association with any real company. people. logo. 9 IMPORT COMMODITY CODES INTO A CATEGORY HIERARCHY . no part of this document may be reproduced. The names of actual companies and products mentioned herein may be the trademarks of their respective owners. product. Microsoft. All rights reserved.com/dynamics The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication.Microsoft Dynamics is a line of integrated. e-mail address. automating and streamlining financial. © 2013 Microsoft Corporation. customer relationship and supply chain processes in a way that helps you drive business success. trademarks.microsoft. stored in. trademarks. patent applications. organization.