Quantcast
Channel: Dynamics AX 2012 Data Import using Excel Add-in
Viewing all articles
Browse latest Browse all 41

Dynamics AX 2012 Data Import using Excel Add-in

$
0
0

Dynamics AX 2012 Excel Add-in – Data Import

Purpose: The purpose of this document is to illustrate how to use Dynamics AX 2012 Excel Add-in for import of data.

Challenge: Data model changes in Dynamics AX related to high normalization and introduction of surrogate keys made import of data more complex. Additionally there are number of differences between Excel and AX Rich Client from UI standpoint when it comes to defaulting logic, use of number sequences, segmented controls and complex UI logic. AX Rich Client is obviously more dynamic comparing to Excel. However a lot of post-processing is usually done behind the scenes by means of AIF Proxy classes when the information is published into Dynamics AX.

Solution: Dynamics AX 2012 ships with the number of AIF Web Service which can be used in integration scenarios. However not all of them can be used in Excel at the moment for import of data. In order to import data using Excel the appropriate tables can be used instead.

Data Model:

Table Name

Table Description

AlexParent

Sample table

AlexTable

Sample header table which extends from sample table

AlexLine

Sample lines table

Data Model Diagram:

Sample Data Model

image

Walkthrough:

Connection

image

Add Tables

image

Dynamics AX Error

image

image

Solution

<!--[if !supportLists]-->-<!--[endif]-->Add replacement key to AlexParent table

<!--[if !supportLists]-->-<!--[endif]-->Add replacement key to AlexTable table

<!--[if !supportLists]-->-<!--[endif]-->Add replacement key to AlexLine table

Project

image

AlexParent table

image

AlexTable table

image

AlexLine table

image

Once Replacement key is added on AlexTable table Excel Add-in will be able to interpret Surrogate key relation between AlexTable table and AlexLine table using Natural key (Replacement key).

Table/Field Properties

image

Query

image

Generate AIF Proxy classes

Select Document Parameters

image

Select Code Generation Parameters

image

Completed

image

Project AxdAlex

image

Generate Incremental CIL

image

Field Chooser

Excel Add-in takes into account table inheritance

Also please note that ID field in AlexTable table (and ParentID field in AlexParent table) is used for Replacement Key <-> Surrogate Key translation

image

AlexTable

Field Name

Field Description

InstanceRelationType

ParentID

ID

A

B

C

D

image

AlexLine

Field Name

Field Description

AlexTable.ParentID

AlexTable.ID

E

F

image

Sequence:

<!--[if !supportLists]-->1.<!--[endif]-->AlexTable – Publish Selected

<!--[if !supportLists]-->2.<!--[endif]-->AlexLine – Publish Selected

Result:

Dynamics AX – Table Browser

AlexParent

image

AlexTable

image

AlexLine

image

SQL Trace:

Summary: For the purposes of small or medium data migration (data conversion) where performance is not a concern Excel can be used for import of data into Dynamics AX 2012. Although some of AIF Web Services can’t be used at the moment in Excel for import of data, appropriate tables can be used instead. Excel template can be created and used for import of data.

Author: Alex Anikiev, PhD, MCP

Tags: Dynamics ERP,Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Table Inheritance, Surrogate Key, Natural Key, Replacement Key.

Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the concepts and describe the examples. It’s recommended that all Data Model changes introduced as a part of this demonstration will be removed once you complete data import exercise.


Viewing all articles
Browse latest Browse all 41

Trending Articles