简体   繁体   English

Dynamics CRM 2011-在安装或部署解决方案时应如何安装自定义实体

[英]Dynamics CRM 2011 - How I should install my custom entities when installing or deploying my solution

I am trying to do a solution which has custom entities and should create some basic data when it is installed by first time, let's say that is going to install some data in 'Roles'. 我正在尝试做一个具有自定义实体的解决方案,并在首次安装时创建一些基本数据,比如说要在“ Roles”中安装一些数据。 How I shoul achieve it? 我该如何实现? I am making code to create this custom entities, but I do not know when execute this code. 我正在编写代码来创建此自定义实体,但是我不知道何时执行此代码。 I saw that there is other way making the custom entities by code or using the UI of solutions, then export it (the solution with the entities are exported) whith that I can import it again to deploy my solution. 我看到还有其他方法可以通过代码或使用解决方案的用户界面来创建自定义实体,然后将其导出(导出具有实体的解决方案),然后我可以再次导入它来部署我的解决方案。

Can somebody point me in the right way? 有人可以用正确的方式指出我吗?

To clear up any confusion of terms here: 要清除此处的术语混淆:

  • Entities: This is a customization of CRM. 实体:这是CRM的自定义。 An entity is to CRM, what a table is to SQL - they dont actually represent any data in themselves. 对CRM来说,实体就是对SQL而言,表就像对SQL一样-它们实际上并不表示自身中的任何数据。 Entities can be included in solutions. 实体可以包含在解决方案中。
  • Records: These are pieces of data that populate entities (or tables). 记录:这些是填充实体(或表)的数据。 These cannot be included in solutions. 这些不能包含在解决方案中。

When you say 'Roles' I assume you are referring to the 'Security Roles', these can be included in solutions. 当您说“角色”时,我假设您是指“安全角色”,它们可以包含在解决方案中。

You can (and should) use a solution file to move all customisations from one environment to another. 您可以(并且应该)使用解决方案文件将所有自定义项从一个环境移至另一个环境。

These are all the parts that can be included in a solution (taken from the MSDN ). 这些都是解决方案中可以包含的所有部分(摘自MSDN )。

在此处输入图片说明

For all your records (or data) you will have to import these manually. 对于所有记录(或数据),您将必须手动导入。 CRM has out of the box features for data import, or you could script it with some web service calls. CRM具有开箱即用的数据导入功能,或者您可以通过一些Web服务调用来编写脚本。

So in this case I believe you need to: 因此,在这种情况下,我认为您需要:

  1. Create your solution in your development environment. 在开发环境中创建您的解决方案。
  2. Import it as a managed solution into your production environment. 将其作为托管解决方案导入到您的生产环境中。
  3. Perform a data import to setup any system/configuration records/data. 执行数据导入以设置任何系统/配置记录/数据。

For a better overview of solutions I would suggest having a read of the MSDN . 为了更好地了解解决方案,我建议您阅读MSDN

Edit (based on comment): 编辑(基于评论):


Re: 1 - You need to build a solution for your customisations and entities. 关于:1-您需要为您的定制和实体构建解决方案。 When you export the solution all the customisations are included automatically in the XML files, you can then import the solution as a whole into another system. 导出解决方案时,所有自定义项都会自动包含在XML文件中,然后可以将解决方案作为一个整体导入另一个系统。

If you dont know how to create a solution watch this video . 如果您不知道如何创建解决方案,请观看此视频

Re: 2 - Do the data import manually once you have imported the solution. 关于:2-导入解决方案后,手动进行数据导入。

If you dont know how to do a data import watch this video . 如果您不知道如何进行数据导入,请观看此视频

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM