Search This Blog

Thursday, 9 August 2012

How To Make Partition In Dynamics Ax 2012

Partitions:         

A partition is a unit of isolation in the AX database
The concept is similar to a company for company specific tables except it is applied to almost all tables
The exceptions include tables related to batch processing, enterprise portal, and services.

Motivation:

A new partition can be used to isolate unit tests and their data from a deployment that has data loaded or that has been corrupted by previously running unit tests

The server team will not accept “partition bugs” that are unit test specific. In other words, unit tests are not a supported scenario, but I have not seen any problems that could not be fixed.

Steps For Making Partitions:

Its quit easy to make partiitions in Dynamics Ax 2012.Just follow the following steps below:

Step 1:Just go to the System Administration->Setup->Partitions as senn below in the image.


















Step 2: Now click the partitions new form will open in that form you will see the existing partitions.You can add the new partition by clicking ithe add button and than give the partition key and partition name as shown in the image below.



Step 3:Now close the form and go to the microsoft dynamics ax configuration as shown in the picture below.


Step 4:Now Microsoft Dynamics Ax configuration utility will open.Now go to Manage and than select create configuration 


Now enter the configuration and than click on




Now enter the name of the partition that you want to apply.and than click apply and than press ok.


Now Run your Microsoft Dynamics Ax your partition will work as i shown in the image below.



Now there is another easy option for running your partition without doing this configuration
just open the command promt and than write the following command.

ax32.exe -partition=partitionname -company=companyname

An example is shown in the picture below


Now if you are planning to run a unit test  on a newly created partition than you need to first initialize the partition without this,many unit tests will fail with a sequence number error in a new partition.
to initialize the partition please run the below job:

NumberSeqApplicationModule::loadAll();
SysUnitTestData_DIR::setupNumberSequences(NumberSeqModule::DIR);
info('done');


Note:

If your unit test use the FIM unit test data(FimUnitTestDataFinancial class) in an existing TTS may still fail in unit test set up.
    The solution is make sure the FIM unit test data in not created in a TTS as shown below.The FIM unit tests data handles its own TTS.





 Thanks

Muhammad Zahid.


No comments:

Post a Comment