最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

AX 2012: Customize DIXF for cross-company import

网络文摘 William 2370浏览 0评论

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)
{
    return _custAccount && _dataAreaId && 
	(select firstonly RecId from custTable
         	index hint AccountIdx
                where custTable.AccountNum == _custAccount
                    && custTable.dataAreaId == _dataAreaId).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. 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.
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址