Consider a scenario where you want to import data into AX 2012 R3 using DIXF, but you want a particular value to be auto-generated by the system rather than input from a text file. The following blog post aims to show how this can be done for a specific DIXF entity, so you have an example of this in action.
In the example below, I am working with the DMFOMOperatingUnitEntity demo data file (CSV - delimited) that ships with AX 2012 R3.
You can usually find this file here:
C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\DemoFiles\Delimited
In this example, I worked with two versions of the demo text file which I called:
OMOperatingUnitEntity1NoAuto.txt
and
OMOperatingUnitEntity1WithAuto.txt.
The files I am working with look like this:
Please note that the file header column info and data may appear truncated - Check the real sample data file for the details
// Execution ID = DMFOMOperatingUnitEntity-1
// Input File = OMOperatingUnitEntity1NoAuto.txt
----------------------------------------------------------------------------------------CountryRegionId,Name,OMOperatingUnitNumber,Address,AddressEmail,AddressEmailName,AddressFax,AddressFaxName,AddressName,AddressPhone,AddressPhoneName,AddressTelex,AddressTelexName,AddressUrl,AddressUrlName,BuildingCompliment,CellularPhone,City,County,DistrictName,DunsNumber,Email,EmailName,FaxName,FirstName,Gender,HCMWorker_WorkerPartyName,HCMWorker_WorkerPartyNumber,HCMWorker_WorkerPersonnelNumber,KnownAs,LanguageId,LastName,Latitude,LocationRole,Longitude,MiddleName,NameAlias,OMOperatingUnitType,OrganizationType,Pager,PartyNumber,PartyType,Phone,PhoneLocal,PhoneName,PhoneticName,PostBox,SMS,State,Street,StreetNumber,TeleFax,TeleFaxName,Telex,TelexName,TimeZone,URL,UrlName,ValidFrom,ValidTo,ZipCode
USA,Admin,101,,test@import.com,E-mail
address,,,Import Address2,,,,,www.Import.com,Import
URL,,,Aguadilla,AGUADILLA,,,Test@import.com,Import
Email,,,,,,,,,,.0000000000000000,Business,.0000000000000000,,,Department,,,000002826,,4253212543,,Phone,,,,PR,,,,,,,0,,,,,00603
----------------------------------------------------------------------------------------
This is the default demo file for the entity and the hardcoded PartyNumber value has been highlighted in yellow
Please note that the file header column info and data may appear truncated - Check the real sample data file for the details
// Execution ID = DMFOMOperatingUnitEntityAuto-1
// Input File = OMOperatingUnitEntity1WithAuto.txt
----------------------------------------------------------------------------------------
CountryRegionId,Name,OMOperatingUnitNumber,Address,AddressEmail,AddressEmailName,AddressFax,AddressFaxName,AddressName,AddressPhone,AddressPhoneName,AddressTelex,AddressTelexName,AddressUrl,AddressUrlName,BuildingCompliment,CellularPhone,City,County,DistrictName,DunsNumber,Email,EmailName,FaxName,FirstName,Gender,HCMWorker_WorkerPartyName,HCMWorker_WorkerPartyNumber,HCMWorker_WorkerPersonnelNumber,KnownAs,LanguageId,LastName,Latitude,LocationRole,Longitude,MiddleName,NameAlias,OMOperatingUnitType,OrganizationType,Pager,PartyNumber,PartyType,Phone,PhoneLocal,PhoneName,PhoneticName,PostBox,SMS,State,Street,StreetNumber,TeleFax,TeleFaxName,Telex,TelexName,TimeZone,URL,UrlName,ValidFrom,ValidTo,ZipCode
USA,Admin,105,,test@import4.com,E-mail
address,,,Import Address6,,,,,www.Import.com,Import URL,,,San Juan,SAN
JUAN,,,Test@import.com,Import
Email,,,,,,,,,,.0000000000000000,Business,.0000000000000000,,,Department,,,,,4253212543,,Phone,,,,PR,,,,,,,0,,,,,00918
----------------------------------------------------------------------------------------
This is the default demo file for the entity and the hardcoded PartyNumber value removed (highlighted in yellow)
So, we now have one file with the hardcoded value in it and one with no value for PartyNumber in it.
1. The processing groups
Let's look at the Processing group where there are no changes to the entity setup and the PartyNumber is hardcoded in the input file.
When you've selected your entity and pointed it to your input file, you will see something like this when you click on Modify source mapping and then click on Mapping details:
If you click on Preview source file you will see that the value is in the input file:
Making the necessary change to use an auto-generated value is simple and only requires that you make a small modification to the source mapping:
Find the PartyNumber line and check the Auto-generated checkbox and you should see that the source field changes from PartyNumber to Auto:
If you click on Preview source file you will see that the value is at the end of the list of fields and reported as 1:
2. The results
Let's look at the data after the Processing groups have run OK and the data has been imported into staging:
You can use a similar approach with other entities if you want the system to auto-generate values.