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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 30.04.2011, 01:13   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Microsoft Dynamics CRM Team Blog: Creating Custom Sample Data for CRM 2011 - Advanced
Источник: http://blogs.msdn.com/b/crm/archive/...-advanced.aspx
==============

We learned how to create a simple sample data for Microsoft Dynamics CRM 2011 in the blog post titled Creating Custom Sample Data for CRM 2011. In this post, we will take a look at some of the more advanced sample data building techniques.

Building a Sample Data Set with Multiple Entities and Related Records

You may want to create multiple related sample data files and then import them into CRM 2011 together. For example, let’s say you create sample data for Account and Contact. You can then create a compressed folder (.zip), drop these sample data files into this folder, and then import the .zip file into CRM from Workplace > Imports. To do so, click on Import Data on the ribbon, and select the .zip file in this dialog below:



Then go through the Import Data Wizard flow. At the end of this process, you would have installed multiple sample data files into your CRM system in one go.

You can create very rich and complex data sets using this method since it allows you to create sample data records that are related to each other. For example, you can set the parent customer field of your sample contacts to sample accounts. The import infrastructure will make multiple passes through your data set and ensure that the records are related properly. The account and contact sample data I created contain the following records:

Contact.xml:
First Name: Yvonne

Last Name: McKay (sample)

Parent Customer: Variety Store (sample)

Account.xml:
Account Name: Variety Store (sample)

Primary Contact: Yvonne McKay

Upon importing the Account.xml and the Contact.xml sample data files, the system makes sure that the contact Yvonne McKay (sample) and the account Variety Store (sample) are linked.

Please keep in mind that for the linking to work, the contacts First Name concatenated to its Last Name must be the exact same string as the account’s Primary Contact field. Similarly, the Account Name needs to be the exact same string as the contact’s Parent Customer.

Relative Dates:

If you create sample data with date fields (such as Actual Close Date for Opportunities), your sample data will look stale if you install it much later compared to when it was created. To make sure your data always looks fresh, no matter when it is installed, you can use dates relative to the time of install. For example, if you want the Actual Close Date of your sample emails to be relative to time of install, you need to do the following:

1. Download the opportunity.xml template as described in the Creating Custom Sample Data for CRM 2011 blog post (follow steps 1 through 4). Then add the following 6 columns to the end of the opportunity.xml file (I prefer using Microsoft Excel for editing sample data files):

Delta

Actual

Close

Year

Delta

Actual

Close

Month

Delta

Actual

Close

Day

Delta

Actual

Close

Hour

Delta

Actual

Close

Minute

Delta

Actual

Close

Second

2. Now you need to create data that has relative start dates. For each opportunity record, enter appropriate values in the Delta Actual Close columns so that the records are relative. For example, the following opportunity’s close date will always be one year in future from the time when the sample data is installed.



3. You now need to create a map that will allow you to use these columns to make the actual close date of your opportunities relative. To do so, import the opportunity.xml file into your CRM system - navigate to Workplace > Imports and click on Import Data on the ribbon, select the opportunity.xml file and click Next. You will see the following screen, in which, change the CRM Fields dropdown to Show Unmapped:





4. Change each field’s drop down to Ignore and click Next:



5. Click Next on this screen:



6. Type in the Data Map Name. In this example, I will call my map RelativeOpportunityMap, and click Submit:



You have just created a basic map for importing opportunities that you will now modify to take relative actual close dates into account.

7. Download the RelativeOpportunityMap by clicking Settings > Data Management > Data Maps, selecting it, and clicking Export (after exporting, delete it from CRM):



8. Save the RelativeOpportunityMap on your desktop. You now need to modify this map so that it adds the values from the 6 Delta Actual Close Date columns to the system time to calculate actual close dates for your sample opportunities. The import infrastructure allows you to add the delta values to the system date by using the Microsoft.Crm.Transformations.AddToCurrentDate transformation in your map. When given the 6 Delta Actual Close Date columns as inputs, and actualclosedate (the actual close date field of an opportunity) as the output, this transformation will add the delta values to the current system date and set that as the actualclosedate for the sample opportunity. To add this transformation to the RelativeOpportunityMap, open it using an XML editor (even though I use Microsoft Excel for editing the sample data files, I prefer using Microsoft Visual Studio for editing the map files). Add the following node as a child node of the EntityMap node:

<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:79d2362e-8f22-4554-a8a9-920b02d3c524" class="wlWriterSmartContent">Microsoft.Crm.Transformations.AddToCurrentDateProcess1ReferenceActual Close Year2ReferenceActual Close Month3ReferenceActual Close Day4ReferenceActual Close Hour5ReferenceActual Close Minute6ReferenceActual Close Second1actualclosedate
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Microsoft Dynamics CRM Team Blog: Microsoft Dynamics CRM Online 2011 Web Services SOAP Sample now ready for Europe & Asia Blog bot Dynamics CRM: Blogs 0 28.03.2011 23:11
Microsoft Dynamics CRM Team Blog: Microsoft Dynamics CRM Online Upgrades Blog bot Dynamics CRM: Blogs 0 12.02.2011 00:11
Microsoft Dynamics CRM Team Blog: Get Social with Vibe and Microsoft Dynamics CRM 2011 (free Community Edition) Blog bot Dynamics CRM: Blogs 0 04.02.2011 00:11
Microsoft Dynamics CRM Team Blog: Custom Report Capabilities in Microsoft Dynamics CRM 2011 Blog bot Dynamics CRM: Blogs 0 29.11.2010 22:11
Все о Microsoft Dynamics CRM: Как установить Microsoft Dynamics CRM 2011 Beta Blog bot Dynamics CRM: Blogs 0 31.10.2010 15:08

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 02:50.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.