Skip to main content

Posts

Showing posts from June, 2013

Test Data Transfer Tool (Beta) [AX 2012]

Recently Microsoft released a beta for transferring data called Test Data Transfer Tool (beta) for Microsoft Dynamics AX 2012 [AX 2012] As described on technet. This tool allows you to transfer data from one environment to a test environment (non-production) via a command line. Installation is very simple. Just follow the wizard. Once installed. In viewing the folder you find this. DP.exe is the main executable to run. An xpo which you can import in to AX. This is just 1 job that allows you to run it against your environment to create a meta data. This meta data looks like this and is found under the [Lists] folder. Under the lists folder you also find some exclude files. These files contain table names which are excluded as part of the export. ie. AIF setups, security setups etc. Now lets see it in action. Run an export via command line. This will generate a file like below in the specified directory. Refer to technet for detail on what each file is.

Create a custom data import export framework entity[AX 2012]

Previously I had created a simple job to import Ledger alias . This post I will look at doing the same with the Data import export framework. There is no entity in the DIEF (Data import export framework) to import ledger alias. So, we have to create a new one. You can follow the Microsoft technet article but I will show you some screenshots here. http://technet.microsoft.com/en-us/library/jj933277.aspx One big thing you will realise is that it isn’t that straight forward for a non-developer. But for a developer it should be relatively easy to create a powerful import entity. 1. Click on Data import export framework > Common > Custom entity wizard Select or enter the table name – in this case it is DimensionAlias. 2. Suggested names and options are set. Leave the default. 3. You will get a message about ForeignKey relationships. Just click yes. This will take some time. A few minutes. 4. You will get errors. 5. A private project will be created. In my case it didn’t

Data Import/Export Framework– Error: SysDictTable object not intialized

Recently I was importing Positions using the Data Import/Export Framework (staging to target process). I got the mentioned error. After doing some debugging I found there was a table “ PayrollPositionDetails ” that was in one of the DMF tables “ DMFTargetEntityHierarchy ”. But the Payroll configuration key was turned off. I ended up deleting the record from the DMFTargetEntityHierarchy table. (Alt+F9 to delete from table browser). Reran the processing group and all worked.

Import ledger alias with a job [AX 2012]

I wrote a job to import the ledger alias in 2012. It is fairly straight forward if you have the DMF installed. Create a csv file with the following: End result will be: Code: //Name,Type,company,Account alias definition,initial focus //test,Shared,CEED,401100-CR_GEN1-OU_3566-Training,MainAccount static void importLedgerAccountAlias( Args _args) { //dialog AsciiIO asciiIO; Filename filename; NoYesId skipFirstLine; Container line; Dialog dialog; DialogField dialogFileName, dialogSkipFirstLine, dialogCountryRegionId; //tables DimensionAlias dimensionAlias ; Ledger ledger; //fields to import DimensionAliasName aliasName; DimensionAliasType aliasType; LedgerNa

Event handler for a clean world [AX 2012]

Eventing has been covered in many blogs and Microsoft has documented it pretty well. I thought I should touch on it a little bit today to bring it back in our conversation. Below is an example of eventing that used. Say you wanted to extend the PurchLine table modifiedField method. In the old days you would modify the method directly. Making it dirty. If you had another ISV making a modification, they would do the same. Meaning, someone has to merge code. Have a look at the example below. PMF stands for Process Manufacturing which used to be separate from the foundation model and similarly BR stands for Brazil which is a country specific module. Both are done using event triggers. See the property they are called Post the method. Pointing to a class. The end result is”No code merging” at all. The only reason I would modify the method directly is if you needed to put your code in the middle of a long process. Long story short. Use eventing for a cleaner environment. Write your co

Project purchase orders consumption in AX 2012 R2

AX 2012 R2 release introduced a couple of new parameter flags on the “Project management and accounting parameters”. Create item requirement – Creates an item requirement if a Purchase order line is created for a project. Item consumption – Posts the item requirement if the purchase order line is received. Lets see “ Create item requirement ” flag in pictures. Below is a purchase order line I created. The form on top is the item requirements line that was created automatically based on the purchase order line. The quantity is maintained. i.e.. If I change the quantity on the purchase order line. It updates the item requirements. But not the other way. Now for the second flag “ Item consumption ” in pictures. I received a quantity of 2. Notice below how the the item requirement was automatically posted at the time of receipt.

Import Project Activity Breakdown (Hierarchy)

I hope this is one of many import blog posts. No promises but I may look at the same written using the Data Import Export Framework to show a comparison. To continue with the subject… I wrote a job to import project work breakdown structure tree. The csv file is in this format. Final outcome is like so. The job code is below: static void ImportActvities( Args _args) { AsciiIO asciiIO; Filename filename; NoYesId skipFirstLine; Container line; Dialog dialog; DialogField dialogFileName, dialogSkipFirstLine; int numProcessedRecords=0; smmActivities smmActivities; ProjTable projTable; ProjActivity projActivity; Hierarchy hierarchy; HierarchyLinkTable hierarchyLinkTable; HierarchyTreeTable rootHierarchyTreeTable, parentHierarchyTreeTable; ProjId projId; smmActivityNumber