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.
Ability to import customers through DIXF across the companies.
Data import export framework has been successfully installed.
1. Create a project to include the following objects:
2. Add new field ImportCompany to DMFCustomerEntity table and set the properties as follows:
3. Add new method existsInCompany to CustTable table and give the following definition:
static server boolean existsInCompany(
found = (select firstonly RecId from CustTable
index hint AccountIdx
where custTable.AccountNum == _custAccount).RecId != 0;
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.
5. Change the RunOn property of class DMFCustomerEntityClass to Server as shown below:
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:
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:
11. Change the current legal entity to any entity other than CEU to test the cross-company import scenario:
12. In the Processing group form click Get staging data to import records in staging table:
13. In the Processing group form click Copy data to target to import records to target table:
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.
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.