Pieter de Jong Pieter de Jong
Mar 30, 2015 12:00:00 AM

Benefit from using STAEDEAN Connectivity Studio for Microsoft Dynamics AX, one of our Business Integration Solutions, to make it easier to export data by using temporary tables.

In your Dynamics AX environment, such temporary tables help you avoid the limitations or complex queries you may face when you need to export pricing with per-customer or product-specific discounts. You can develop your calculations as usual in the application object tree (AOT). In today’s post, we take you through the few easy steps you take when you use Connectivity Studio to perform data exports with temporary tables.

In this usage scenario, you learn how to populate a temporary table with two records and export it to an XML file. To export prices by using a temporary table, you need to take the following simple steps:

  • Create a message using the message setup wizard
  • Create the Dynamics AX source document and connector
  • Create the target XML document and connector
  • Extend the document class to insert data into the temporary table
  • Run the message

Create a message using the message setup wizard
When you select the project, you can create a new Connectivity Studio message by using the message setup wizard. You see the concept and components of the message setup in the overview on the start screen.

How to create a new Connectivity Studio message using message set up wizard

On the next page, you start with the actual setup of the message.

Simplify Dynamics AX Data Exports 1

Because you want to export data, you need to specify a source application, Microsoft Dynamics AX, as well as a target application called ERP. Other details you need:

  • Source connector: Existing Active company
  • Source document: New, with the type Microsoft Dynamics AX
  • Target connector: Existing Folder
  • Target document: New, with the type XML

Export data with Connectivity Studio for Dynamics AX

Now you can define which table you want to export to XML. In Connectivity Studio, you specify a temporary table called TmpSalesItemReq, and select the fields SalesPrice, SalesUnit, and ItemId. The message is then created with a default mapping for the selected fields.

Simplify Dynamics AX Data Exports 4

Extend the document class to insert data into temporary tables
Now you need to create data in this table and make sure your source document can use it. The easiest way to accomplish that is to use the Extend class function in the action pane.

Simplify Dynamics AX Data Exports 5

In Connectivity Studio, it’s easy to rename temporary tables and de-class them.

How to rename temporary tables and reclass them on Connectivity Studio

Now you can add data to the temporary table and use it in the message you created earlier.

How to use temporary table in Connectivity Studio message

To read the entity set for the query, you call the next method and construct it as below. Be aware that the Data method is used to break the link with the query by creating a copy of the record.

How to read entity set for query on Connectivity Studio

Now you can link the new class in the source document.

Run the message
You have finished the setup! You can now run the message and see its history.

How to run Connectivity Studio message and see its history

The XML results contain the fields you defined in the XML document.

XML results on Connectivity Studio for Dynamics AX

If you like, contact us to get a free XPO file to practice using Connectivity Studio to create temporary tables and export data in your Dynamics AX environment.

These are all the actions you need to take in order to export temporary tables with STAEDEAN Connectivity Studio. As you see, it’s very easy to extend Connectivity Studio with code to support custom processes.

Pieter de Jong Pieter de Jong
TI_LOGO_TI-Logo-color andAXP_365

have now rebranded to

staedean-logo-teal