AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 16.10.2015, 21:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
emeadaxsupport: DIXF - Importing Data - How to use Auto-generated to import PartyNumber
Источник: http://blogs.msdn.com/b/axsupport/ar...rtynumber.aspx
==============

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.




Источник: http://blogs.msdn.com/b/axsupport/ar...rtynumber.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
emeadaxsupport: DIXF - Importing Data - How to establish which rows you need to look at when you aren't able to import every row in your input file Blog bot DAX Blogs 0 08.10.2015 15:11
emeadaxsupport: Importing a General Journal using Data Import/Export Framework AX 2012 Blog bot DAX Blogs 0 17.07.2014 20:12
emeadaxsupport: SEPA affected objects Blog bot DAX Blogs 0 29.11.2013 13:11
atinkerersnotebook: Walkthrough & Tutorial Summary Blog bot DAX Blogs 1 09.09.2013 09:11
Microsoft Dynamics CRM Team Blog: Create Sample Data for your Solution Blog bot Dynamics CRM: Blogs 0 01.12.2011 05:14

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 15:10.