Friday, July 20, 2012

AX 2012 Data Migration Framework (beta) Configuration and Execution

Using the data migration tool is fairly simple; however, an understanding of different business entities and their data model is highly required to successfully migrate the data.
In this post, I will take a sample scenario to walk through the configuration and setup of data migration framework. We will consider couple of entities to migrate the data. Let’s assume that we need to migrate customer master data from a source system to AX 2012. Follow these steps to achieve the objective:
Navigate to Data Migration Framework module in AX 2012 application workspace. Open Setup>Target entities form.

The target entities out of the box available are listed in this form. You can select an entity and modify its staging to target mapping if you would like to (in case you have customizations in AX). Here, we are going with what is available out of the box. You can also validate the mapping after modifying it, view the target entity hierarchy, and target fields for any selected entity. You can also create a new record for a custom target entity.
Now we have to define the data format for our source data. Open Source data formats from Setup area and create a new record as shown below:
I have selected File format as Delimited with first row as header and values are separated with comma. Also marked the source file to be Unicode. It is often the case that primary entity might have multiple sub records associated with it. For example, a customer might have two addresses. In such situation, you can use the Role Separator to distinguish these multiple records.
Now the next step is to create processing group (Common>Processing group) for customer data migration. By definition, processing group is a logical grouping of entities that need to be imported in sequential order.
 
Add the entities into the processing group.
At this point, let’s use the generate source file wizard to generate the source customer file for import. You can also create your own source file as per the format specified in Source data formats.

Click Next. On the screen below, you have the option to only use the fields present in source for customer import or include other fields.
Click Generate sample file and the wizard will provide you a file as shown below. Save the file in a folder as later we will need to refer to that location.

Once the file is generated and saved, put some data in it and provide its location in the Sample file path field.



Our next step is to generate the source to staging mapping. Note that you get the infolog “Mapping has completed successfully”. At this point, you can also modify the source to staging mapping. In our case, we don’t have to.

Target mapping with corresponding staging table can also be viewed. You also have the option to run the business logic or validations in entity’s insert update or validateWrite methods at the time of import. Data preview for staging table can also be analyzed in the preview pane. This is how the data will look like in the staging table.
Next step is to push the data from source file to staging table.

A dialog will appear with auto generated job Id. Click OK and Staging data execution screen will appear.

Click Run. You can also run this job on AOS if you would like to. You can also preview the staging data here. After the job is executed, an infolog will appear mentioning that a record has been successfully created in the staging table.
Once the data is in staging table, it just the matter of pushing it to target (AX) entity’s table.
A dialog will appear asking for the job that was executed previously to push the data from source to staging. Select ‘Customer-6’ in this case.
Click OK. Target data processing screen will appear.
Click Run. After the job is executed, an infolog will appear mentioning the record is created in the target entity.



You can cross verify in ‘CustTable’ and corresponding staging table ‘DMFCustomerEntity’ for customer entity.
The framework gives really cool feature of exception logging. You can see any errors that might have occurred during the source-staging or staging-target job execution.
With this I close the post and hope it will give you a kick start leveraging other really powerful features of DMF.


Wednesday, July 18, 2012

AX 2012 Data Migration Framework (beta) Installation

In this post, I would like to shed some light on the Data Migration Framework recently published by Microsoft as beta. I will start with installation and configuration of the tool and later would like to share the experience of using the tool using development environment.

Open up the installation wizard using Setup.exe file that comes up with the tool.

As I am installing the tool on development machine, I have selected both Client and Server components. If you have AOS on different server and client on another, you will have to install the components separately on respective machines.

Select the file location where the setup has to put the files. I will leave it as default selected.



The installation wizard is now completed and setup log file is opened. Good to take a look at the setup log file at the end.

Now you have to update the buffer size in AOS configuration utility. The reason mentioned by MS is that the staging table (for corresponding target entity) used by the tool is highly normalized and the migration process takes extra processing capacity, so recommended to have the buffer size increased from default 24K to 48K. Please do remember to revert it back to 24K after the data migration is done.



After the AOS is restarted, you will have to import the model file (DataMigrationFramework.axmodel) found in “C:\Program Files\Microsoft Dynamics AX 2012 Data Migration Framework (Beta)” to target AX 2012. I will use AX 2012 Management Shell to import the file:


As recommended, restart the AOS. Open AX 2012 client and you will be presented with a checklist as we just imported a new model into model store. Again as suggested by AxUtil, we will select the option of “Compile and synchronize” from the checklist and click OK. This will take some time, so have a cup of tea until it gets finished (I had my lunch thoughJ).

After the compile and synchronize is completed, you should see a new module in AX named “Data migration framework”. In my next post, I will take a sample scenario to start configuring the framework and use it to import some data from a source system.

Friday, June 15, 2012

Retail Solution for AX 2012 - Deployment (Part 1)

Scenario

Big Chain Stores is opening up a retail store in City Center and they want to consume Retail solution comes with MS Dynamics AX 2012. At this point, they only have one POS terminal in the store and they do not want to have an offline database for that terminal. All they need is to have a shared database residing on Store SQL machine. In this scenario, it is assumed that all the required information like customers, items, prices, sales tax etc. are already there in AX. 

Store


·         Make sure that SQL Server 2008 R2 is installed on Store machine
·         Install Retail Store Connect on Store machine (in my case same machine as the SQL is installed)
o   Retail Salt Utility will automatically be installed
·         Install Database Utility on Store machine
o   Create Store DB by providing names in SQL database and machine fields
o   Fill in Store ID, Terminal ID and Data Area ID fields with dummy values for now. However, later you should add records in Retail HQ (in AX) for the same values.
·        Please note that no “Microsoft Dynamics AX for Retail Offline Sync Service” is available on Store machine. This service is used to synchronize POS terminal offline database with Store database and get installed on POS terminal machine when POS terminal component is installed
·        Now you need to create the Store Connect message database in Store SQL server. For that, open up the Retail Store Connect Settings utility and click on Add. The system will ask you for server name and database name. Enter the server name and message database name (that will be created). Enter the account details which in my case were the user through which I accessed the Store machine. Make sure to enter the user name as domain\user
·       Once the message database is created in SQL, make sure the tables are there. Now select the Store Connect Service instance from Retail Store Connect Settings dialog and start the service.

HQ


·         Initialize the Retail HQ from Retail Parameters in AX



·       On both profiles, select the Retail Transaction Service profile and Retail Store Connect Upload options. You can create one upload option for both profiles, however, select different Retail Transaction Service profile in both store connect profiles. After you do this, send the configuration to respective servers. In Store Connect message database under SQL server, check the SCMMonitoringConfig table and it should have a record. This must be true for both HQ and Store SQL message databases.
·       Now you need to create the Store Connect message database in HQ SQL server. For that, open up the Retail Store Connect Settings utility and click on Add. The system will ask you for server name and database name. Enter the server name and message database name (that will be created). Enter the account details which in my case were the user through which I accessed the Store machine. Make sure to enter the user name as domain\user.
·        Once the message database is created in SQL, make sure the tables are there. Now select the Store Connect Service instance from Retail Store Connect Settings dialog and start the service.
·        Create AOS profile and use the Retail Store connect profile for HQ that you created in previous step in Retail Store Connect field. Make sure that you test the connection.
·        Create Database profile, select Store SQL machine name as Server name and Store database you created earlier as Database name. Select Store Connect profile that you created earlier for the Store in Retail Store Connect field. After creating the profile, test the connection.

·        Create the Store record using Retail Stores listpage in Retail module of AX. Name of the store should match with the Store ID that you specified in Database utility on Store machine.
·        Create hardware and visual profiles in Retail module. Use F1 help to create these profiles and more information.
·        Create POS Terminal record using Retail>Setup>POS>POS terminals form. The Terminal Number must match with what you have provided in the Terminal ID field specified in Database utility on Store machine.
·        Enter any other required information in HQ like hardware profiles, card type, till layouts etc. as mentioned in the official deployment guide by MS.
·       Check that a Distribution location (Retail > Setup > Retail scheduler > Distribution locations) is created corresponding to the Store record. Make sure to select the connection profile of type “Database” for the distribution location record. From Functions, select “Read design with Retail Store Connect” and accept the default values in following dialog. Click Ok. This will list down the tables in the Location tables form for this particular location. Now test the connection and send the configuration to Store server.
·       Access Distribution location list from Retail>Setup>Retail scheduler>Distribution location list and add the distribution location created in the previous step in Distribution locations grid.
·        Now open up Distribution schedule form from Retail>Periodic>Retail scheduler>Distribution schedule. By default, you should get the ‘A’, ‘N’ and ‘P’ jobs listed in the form.  Run all the ‘N’ jobs directly one by one. After all the jobs are executed, you should get the store database populated with data from HQ. Make sure you select the correct AOS connection profile against each job before running it. You will get a success message when a particular job is executed as shown below:


After the jobs are executed, the store database is populated with required information. Next step is to deploy the POS terminal on a separate machine (other than store). Wait for part 2 of this post...............

Friday, June 1, 2012

Domains in AX are no longer used

In AX2009 and previous versions, domains were used by administrators to group multiple companies and then assign user permissions to those companies. In AX 2012, the concept of Domains has been deprecated. Instead an Organization Hierarchy whose Purpose is Security is used.

Wednesday, May 23, 2012

Dynamic Role Assignment

Another very powerful feature of AX2012 is the automatic assignment of security roles to users based on certain criteria. A security administrator can select rule in "Assign users to roles" form against a particular role. A rule is actually an AOT query that can be created with the help of a developer. An special thing about the query is that the it is modeled with UserInfo table as the first datasource. Dynamic role assignment helps in scenarios where employees are promoted to a different title or designation, in case of inter departmental transfers or when new employees are taken on board.

Tuesday, May 8, 2012

Management Reporter Services

You might have noticed installation wizard asking for two services while installing Management Reporter server component. The application service is used by MR clients to connect with server and access the MR data. While the process service is used to generate reports that MR clients push to report queue.