DIXF

AX 2012: Add custom field to standard DIXF target entity

Posted on

Purpose:

The purpose of this document is to describe how we can add custom fields to standard DIXF target entity. While performing data migration for standard entities like customer, we often come across a requirement to load data for customized fields as well. In this post, we will add custom fields of customer master to its standard DIXF entity.

Business requirement:

To load customer master through DIXF along with custom fields.

Assumptions:

1. Custom fields are already added to CustTable table.
2. DIXF component is up and running.
3. ODBC source data format has been configured.
4. Prestaging database and table is ready to fetch data from.

untitled

Development:

1. The following are the custom fields that need to be loaded through standard DIXF entity for customer master:

untitled

2. Add custom fields to DMFCustomerEntity table, which is the standard DIXF staging entity for customer master.

untitled

3. Add the same fields to the DMF field group of DMFCustomerEntity table.
4. Add the same fields to DMFCustomerTargetEntity query.

Queries > DMFCustomerTargetEntity > Data Sources > Customer(CustTable) > Fields

5. Make sure the same fields exist in the target entity, CustTable table.
6. Open Data import export framework > Setup > Target entities
7. Create new target entity as follows. You must create a new target entity to include the newly added fields.

untitled

8. Verify the newly added fields by looking at the mappings.

untitled

9. Create new processing group and select the newly created target entity

untitled

10. Generate source mapping and verify the mappings by clicking Modify source mapping.

untitled

11. You can also preview the source data by clicking Preview source file to validate data is pulling up correctly.

untitled

12. Get staging data

untitled

untitled

13. Copy data to target.

untitled

untitled

14. You can verify loaded customers in All customers list page.

untitled

15. You can also verify custom fields loaded successfully!

untitled

 

AX 2012: Customize DIXF for cross-company import

Posted on Updated on

Purpose:

The purpose of this document is to demonstrate how we can customize DIXF (Data Import Export Framework) to import customers across the companies. The standard DIXF can only import records in the current company/legal entity. Customization will allow us to perform cross-company data import.

Business requirement:

Ability to import customers through DIXF across the companies.

Assumptions:

Data import export framework has been successfully installed.

Development:

1. Create a project to include the following objects:

Untitled

2. Add new field ImportCompany to DMFCustomerEntity table and set the properties as follows:

Untitled

3. Add new method existsInCompany to CustTable table and give the following definition:

static server boolean existsInCompany(
	CustAccount _custAccount,
	DataAreaId _dataAreaId)
{
    boolean found;

    changeCompany(_dataAreaId)
    {
        found = (select firstonly RecId from CustTable
         	    index hint AccountIdx
                        where custTable.AccountNum == _custAccount).RecId != 0;
    }

    return boolean;
}

4. Customize method insertUpdate of class DMFCustomerEntityClass to have the following definition. You can see that the modification has been wrapped within the BEGIN MOD and END MOD comments.

Untitled

5. Change the RunOn property of class DMFCustomerEntityClass to Server as shown below:

Untitled

6. Create new Data import export framework > Common > Processing group to import customers.

7. In the Select entities for processing group form:

  • select Customer for Entity
  • select Excel for Source data format
  • Generate source file

8. Prepare sample customer data to be imported as follows:

Untitled

9. In the Select entities for processing group form:

  • select the file in the Sample file path
  • Generate source mapping
  • Preview source file

10. You should be able to preview the sample data without any error:

Untitled

11. Change the current legal entity to any entity other than CEU to test the cross-company import scenario:

Untitled

12. In the Processing group form click Get staging data to import records in staging table:

Untitled

13. In the Processing group form click Copy data to target to import records to target table:

Untitled

14. Change the current legal entity back to CEU.

15. Click Accounts receivable > Common > Customers > All customers. You should be able to see the newly imported customers.

Untitled

As you have seen that we have successfully imported customers to CEU legal entity while being logged in to DAT legal entity, we can use the same customization to perform cross-company import. We just need to fill in the different legal entities in the ImportCompany column of the source Excel file.