using the dynamics ax 2012 excel add-in to import and publish data

83
© 2013. All rights reserved. USING THE DYNAMICS AX EXCEL ADD-IN Dynamics AX | Excel | Data Management The Excel Add-In is an incredibly useful tool because it doesn’t just allow you to download information from Dynamics AX, but it also allows you to publish information back to the system without compromising the data integrity. You can use this for the initial data setup within Dynamics AX, quick maintenance of multiple records, moving data from one system to another, and even aggregating data through matrix fields. And best of all, this tool is included for free with Dynamics AX, so you don’t need to buy additional licenses in order to use it. In this worked example we will show how you can use the Dynamics AX Excel Add-In to make updating data a breeze.

Upload: murray-fife

Post on 08-May-2015

8.624 views

Category:

Technology


9 download

DESCRIPTION

The Excel Add-In is an incredibly useful tool because it doesn’t just allow you to download information from Dynamics AX, but it also allows you to publish information back to the system without compromising the data integrity. You can use this for the initial data setup within Dynamics AX, quick maintenance of multiple records, moving data from one system to another, and even aggregating data through matrix fields. And best of all, this tool is included for free with Dynamics AX, so you don’t need to buy additional licenses in order to use it. In this worked example we will show how you can use the Dynamics AX Excel Add-In to make updating data a breeze.

TRANSCRIPT

© 2013. All rights reserved.

USING THE DYNAMICS AX EXCEL ADD-IN

Dynamics AX | Excel | Data Management

The Excel Add-In is an incredibly useful tool because it doesn’t just allow you to download information from Dynamics AX, but it also allows you to publish information back to the system without compromising the data integrity. You can use this for the initial data setup within Dynamics AX, quick maintenance of multiple records, moving data from one system to another, and even aggregating data through matrix fields. And best of all, this tool is included for free with Dynamics AX, so you don’t need to buy additional licenses in order to use it.

In this worked example we will show how you can use the Dynamics AX Excel Add-In to make updating data a breeze.

© 2013. All rights reserved.

INSTALLING THE DYNAMICS AX EXCEL ADD-IN

Before you start working through these examples, you need to make sure that you have the Dynamics AX Excel Add-In installed. If you open up Excel and there is a Dynamics AX tab in the ribbon bar, then you are fine. If not, you will need to install it.

In this section we will show you where to find the install kit and how to install it.

© 2013. All rights reserved.

Installing The

Dynamics AX Excel

Add-In

The installation for the Office Add-Ins are included on the Dynamics AX 2021 installation kit. To find them, just select the Microsoft Dynamics AX Components from the Install group.

© 2013. All rights reserved.

Installing The

Dynamics AX Excel

Add-In

Skip through the welcome page by clicking on the Nextbutton.

© 2013. All rights reserved.

Installing The

Dynamics AX Excel

Add-In

Make sure that you have the Add or modify componentsoption checked on the next step of the dialog box and then click Next.

© 2013. All rights reserved.

Installing The

Dynamics AX Excel

Add-In

When the Add or modify components page is displayed, check the Office add-ins option within the Client components group, and then click Next, and complete the installation.

© 2013. All rights reserved.

Installing The

Dynamics AX Excel

Add-In

Now, when you open up Excel, you should see a Dynamics AX tab with a couple of new options for you.

© 2013. All rights reserved.

DOWNLOADING & PUBLISHING DATA

THROUGH EXCELOnce you have the Excel Add-In installed, you can start using it to download, update, and publish Dynamics AX data. This is useful not only for initial data loading, but also for ongoing maintenance of the system, because it allows you to maintain records within Dynamics AX quickly through Excel.

In this example we will show how you can download and publish changes to Dynamics AX records.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

You can update pretty much any data that you are able to access through the Dynamics AX client. All you need to know is where to find it.

If you don’t know what table to update though, here is a quick trick. Find a form that has the data that you want to update through Excel.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

Then right-mouse-click on the form and select the Personalize option from the context menu.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

When the Personalization form is displayed, select the Query tab. This shows all of the tables that are related to the form, and if you look at the first data source, then it is usually the table that you want to access.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

To created a linked worksheet within Excel, select the Dynamics AX ribbon bar, and then from the dropdown menu of the Add data button, click on the Add Tablesoption.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

This will open up a table selection dialog box. You can scroll down the list to find the table that you want to add to your worksheet.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

Or you can also just type in the table name in the Filterfield at the bottom of the form.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

Select the table, and then click on the > button to add the table to the selected tables. You can continue adding tables if you want, and when you are finished, click on the OK button.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

This will create a new worksheet for all of the tables that you selected to add, and also open up the field explorer on the left hand side with all of the available fields that you can select from.

Note that the initial index fields are added by default to your worksheet, saving a little bit of time.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

Now from the field list on the left, select all of the fields that you want to include in the worksheet.

When you have finished, click on the Fields button in the Design group of the Dynamics AX ribbon bar to return to update mode.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

When you swap from the field listing to the edit mode, you will initially have no records showing. To view all of the data that is in the company, select the Refresh button and then select the Refresh All iption.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

Now you will see all of the records from Dynamics AX.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

To add a new record, simply start adding a new line on the next available row. It will automatically extend the table showing you that you are inserting a new line.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

Also, as you are updating the records, if there is an enumeration associated with the field, then you can select it from a drop down, saving you time in trying to work out what the values should be.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

After you have added your new record, then select the Publish All option from the Publish button.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

If all of your field values are correct, and you don’t add any records that already exist, then the table will refresh and you will now see your new record.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

It will also create a new sheet called Dynamics AX Status which will show you how many records were updated, and also any errors – if they occurred.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

If we return back to Dynamics AX, then we will see the new record is there as well.

© 2013. All rights reserved.

Downloading &

Publishing Data

Through Excel

You can use this for initial data loading, saving a lot of repetitive data updates. For example, you can use this for adding all of the common codes that you need for a new company, and even for adding new chart of accounts in just seconds.

© 2013. All rights reserved.

USING FILTERS TO UPDATE SELECT DATA

The Excel Add-In has a feature that allows you to filter out the data that is returned every time that you refresh the worksheets. This allows you to easily update just the information that you are interested in. This is really useful for maintenance of data where you need to update a number of records at once that match a certain criteria, because you can download all of the records, select the items that you want to view, and then quickly maintain the fields and publish them back to Dynamics AX.

In this example we will show you how to filter a table query and then update multiple records at once.

© 2013. All rights reserved.

Using Filters to

Update Select Data

In this example, we have queries the Vendors table.

© 2013. All rights reserved.

Using Filters to

Update Select Data

Since this is still an Excel table, you can filter on any of the fields.

© 2013. All rights reserved.

Using Filters to

Update Select Data

You can select any of the values that are in the table for the filter, and then click OK.

© 2013. All rights reserved.

Using Filters to

Update Select Data

This returns a subset of the data.

© 2013. All rights reserved.

Using Filters to

Update Select Data

Another option though is to open up the Add-In’s filter by clicking on the Filter button within the Dynamics AXribbon bar. This will open up the filter designer. You can add a filter condition simply by clicking on the Add condition button.

© 2013. All rights reserved.

Using Filters to

Update Select Data

This will allow you to select a field that you want to filter on.

© 2013. All rights reserved.

Using Filters to

Update Select Data

And also, if you click on the … button, it will show you a list of all the valid field values that you can apply to the filter.

© 2013. All rights reserved.

Using Filters to

Update Select Data

You can continue to add as many filters as you want, and when you are done, click on the OK button.

© 2013. All rights reserved.

Using Filters to

Update Select Data

The next time that you refresh the data, you will only get the data that matches the filter criteria. This is better than the Excel filter, because all of the additional records are not returned, rather than being hidden in the traditional filter.

© 2013. All rights reserved.

Using Filters to

Update Select Data

Once you have your dataset that you want to update, you can change any of the field values.

© 2013. All rights reserved.

Using Filters to

Update Select Data

And then to update all of the selected records, just click on the Publish All option within the Publish buttons drop down list.

© 2013. All rights reserved.

Using Filters to

Update Select Data

The Add-In will notify you of any problems, and also confirm that the records were updated.

This is useful for all of the final tweaking of data that you always do after you load all the records, and also for periodic changes to the subsets of data that you always have to perform.

© 2013. All rights reserved.

COPYING DATA BETWEEN COMPANIES

Another useful way that you can take advantage of the Excel Add-In is for data migration. You have the option of selecting what instance, partition, and company that you want to upload and publish to, and they don’t have to be the same. So if you have a test and a live environment, and you want to move data between the two to ensure that you have the same configuration codes, then you can download the data from one, and then publish it to another. Or, if you are configuring a new company, then you can copy a lot of the base data from another existing company, saving time.

In this example we will show how you can use the Excel Add-In to copy data between entities.

© 2013. All rights reserved.

Copying Data

Between

Companies

In another company, I have not loaded all of my base data, so we will use our main company as the template to load the data.

© 2013. All rights reserved.

Copying Data

Between

Companies

From the Dynamics AX ribbon bar, select the Optionsbutton from the Configure group. This will option up the data source options for the current worksheet.

© 2013. All rights reserved.

Copying Data

Between

Companies

You can change the Legal Entity that will be used just by selecting it from the drop down list.

© 2013. All rights reserved.

Copying Data

Between

Companies

Note also that you can change the Server to point to another instance of Dynamics AX, and also change the Partition if you have multiple instances stored within the same database instance. Once you have selected the new target company, click on the OK button.

© 2013. All rights reserved.

Copying Data

Between

Companies

Before we refresh the data, we will save off the data from the original company for reference. This will make it easier to cut and paste the data back into the new company. So we just select all of the original table, and then copy it.

© 2013. All rights reserved.

Copying Data

Between

Companies

Then paste the data over to the right of the main data.

© 2013. All rights reserved.

Copying Data

Between

Companies

Now that we have the template data saved we can continue on.

© 2013. All rights reserved.

Copying Data

Between

Companies

Return back to the linked table, and then select the Refresh All option from the Refresh drop down.

© 2013. All rights reserved.

Copying Data

Between

Companies

Since there is no data in the other company then the linked table will be blank.

© 2013. All rights reserved.

Copying Data

Between

Companies

Select the template data that you saved and then paste it as text into the linked table.

© 2013. All rights reserved.

Copying Data

Between

Companies

This will add all of the data for you so that it matches the template. Although notice that I didn’t populate the Terms of Payment etc. here in this example – that’s only because those tables are not configured, but highlight that you can cleanse the data before pasting it in/

© 2013. All rights reserved.

Copying Data

Between

Companies

Now from the Publish ribbon bat menu, select the Publish All option to push the data to the new company.

© 2013. All rights reserved.

Copying Data

Between

Companies

If there are no errors, then the table should simply refresh itself. If there are errors in the update then you can check the Dynamics AX Status sheet to see what they are.

© 2013. All rights reserved.

Copying Data

Between

Companies

Now when we look back into Dynamics AX then all of our new data is in the new company.

© 2013. All rights reserved.

Copying Data

Between

Companies

Once you have created the template worksheet you can then save it away and reuse it at any time. If you really want to be clever then you can create a worksheet that has all of the common data that you need to load and re-use it over and over again.

© 2013. All rights reserved.

IMPORTING COMPLEX DATA STRUCTURES

Not everything is as simple as loading one table at a time though. For more complex data structures like Products, Customers, Vendors, BOM’s etc. you may need to load multiple tables in order to get all of the data to show. You can do this as well through the Excel Add-In, you just need a little more planning.

In this example we will show how you can use the Excel Add-In to create a template for loading master data within Dynamics AX.

© 2013. All rights reserved.

Importing Complex

Data Structures

As an example, in order to load a product, you need to populate (in this order) a minimum of three tables:

• EcoResProduct

• EcoResProductTranslation

• InventTable

EcoResProduct

PK RecId

EcoResProductIdentifier

PK RecId

FK1 Product

EcoResProductMaster

PK,FK1 RecId

EcoResDistinctProduct

PK,FK1 RecId

EcoResDistinctProductVariant

PK,FK1 RecId

FK2 ProductMaster

EcoResInstanceValue

PK RecId

EcoResProductInstanceValue

PK,FK2 RecId

FK1 Product

EcoResProductDimensionGroupProduct

PK RecId

FK1 ProductFK2 ProductDimensionGroup

EcoResProductDimensionGroup

PK RecId

© 2013. All rights reserved.

Importing Complex

Data Structures

In this example we were given a raw extract of all the products that we need to import into Dynamics AX which we pasted into our worksheet.

Then to create an import template, first link in the tables that you want to load into the worksheet.

© 2013. All rights reserved.

Importing Complex

Data Structures

Because the raw data is not in the format that we really want to in we also created a new Product Data sheet, and then massaged the data a little to tidy up the information.

© 2013. All rights reserved.

Importing Complex

Data Structures

Each of the tables that we need to load will be in their own sheet within the worksheet.

© 2013. All rights reserved.

Importing Complex

Data Structures

We use the column headings that we have selected to populate for the sub-tables as a template column in the Product Data worksheet and then use formulas to map the fields.

© 2013. All rights reserved.

Importing Complex

Data Structures

Now it’s just a matter of copying the data in blocks from the Product Data sheet over to the linked tables.

© 2013. All rights reserved.

Importing Complex

Data Structures

And then selecting the Publish All option from the Dynamics AX ribbon bar. You can reuse this template once it’s created to load masses of data without even breaking a sweat.

© 2013. All rights reserved.

USING MATRIX FIELDS TO UPDATE MULTIPLE

RECORDSThere is another neat feature that available with the Excel Add-In which allows you to create new Matrix Fields. These are query fields that allow you to aggregate data and show it as one value, making some data updates even simpler. You can use this for summing data, and also segregating data into groupings such as period ranges.

In this example we will show how you can use the Matrix Fields option to created total and period based aggregate fields.

© 2013. All rights reserved.

Using Matrix Fields

to Update Multiple

Records

For example, forecast data is managed within Dynamics AX at a calendar date level.

© 2013. All rights reserved.

Using Matrix Fields

to Update Multiple

Records

If we look at this information through Excel, then it is not really conducive to updates because it is more linier rather than the normal tabular view that most people want to work with.

© 2013. All rights reserved.

Using Matrix Fields

to Update Multiple

Records

To aggregate the data, right-mouse-click on the table name within the field explorer and select the Create Matrix Field option.

© 2013. All rights reserved.

Using Matrix Fields

to Update Multiple

Records

This will open up a dialog box that allows you to create a new field based on an existing field.

© 2013. All rights reserved.

Using Matrix Fields

to Update Multiple

Records

Also you can filter the data so that you only select certain groups of values. This is useful because you can create period based fields that only apply to certain dates within the data selection.

© 2013. All rights reserved.

Using Matrix Fields

to Update Multiple

Records

To use the Matrix Field, just create a new worksheet, and select the fields that you want to summarize to, and then add the matrix field.

© 2013. All rights reserved.

Using Matrix Fields

to Update Multiple

Records

When you refresh the data, then you will see the matrix field summing up all of the child values.

If you update any of the values, then it will prorate the changes over all of the related table records.

© 2013. All rights reserved.

Using Matrix Fields

to Update Multiple

Records

If you take this to the next level, you can then create Matrix Fields for periods, and then use it in this case to forecast by date ranges.

© 2013. All rights reserved.

IMPORTING & EXPORTING DATA THROUGH

DOCUMENT SERVICESThere is one additional way that you can query and publish data with the Excel Add-In, and that is through the Document Services that are published within Dynamics AX. This is a little different from the table links, because it is accessing the data through classes, allowing you to update more than one table at a time, but also requires a little bit of coding in order to get new services configured. Luckily, there are some services that have already been deployed with Dynamics AX that you can use this on.

In this example we will show how you can use the Data option within the Excel Add-In to query and publish data.

© 2013. All rights reserved.

Importing &

Exporting Data

Through Document

Services

Open the Document data sources menu item within the Document management folder in the Setup group of the System Administration area. This will list out all of the registered document services that you are able to use within Dynamics AX.

© 2013. All rights reserved.

Importing &

Exporting Data

Through Document

Services

To use these with Excel, select the Add Data option from the Add Data button of the Dynamics AX ribbon bar.

© 2013. All rights reserved.

Importing &

Exporting Data

Through Document

Services

When the Add Data dialog box is displayed, you should be able to see the same data sources.

Note, some of the data sources have pencils in the icon, this indicates that you can publish the data through them – otherwise they are just read only.

© 2013. All rights reserved.

Importing &

Exporting Data

Through Document

Services

The data services work exactly the same way as the tables, by showing you all of the available fields that you can add to the sheet.

© 2013. All rights reserved.

Importing &

Exporting Data

Through Document

Services

Just select the fields that you want to use, and drop them onto your sheet.

© 2013. All rights reserved.

Importing &

Exporting Data

Through Document

Services

When you switch to edit mode, you can refresh the data, and then retrieve all of the records.

© 2013. All rights reserved.

Importing &

Exporting Data

Through Document

Services

If you want, you can also create Matric Fields as well to reformat the way that the data is displayed.

© 2013. All rights reserved.

SUMMARY

In this walkthrough we showed how you can use the Dynamics AX Excel Add-In in a number of different ways to query, and also to publish data. It is a great tool to use to create update templates and also to make a lot of periodic update tasks a lot easier.

http://slideshare.net/murrayfife/presentations

Murray FifeMicrosoft MVP