- Microsoft Dynamics CRM 2011 Scripting Cookbook
- Nicolae Tarla
- 609字
- 2021-07-27 18:12:37
Creating and managing entities
In this recipe, we'll go through the process of creating a new entity, look at how to configure such an entity, and in the end, how to clean up an entity that's not required in our solution package.
All customizations in this book are created as part of a solution. As such, we will be reusing the previously created solution.
Getting ready
In order to proceed, log in to your existing Dynamics CRM 2011 instance and navigate to the solution we created previously.
How to do it...
In the created solution package, we will be adding a new entity to store a list of all countries. We want this listing to be manageable by a user with proper permissions, so that it can be updated as they do business with new countries.
- Open the solution, and navigate to the Entities tab.
- Click on New to add a new entity to the solution.
- Fill in the mandatory fields, and define where this entity will be visible. In our case, we will make this entity visible only in the Settings area. We are setting the Ownership of this entity to Organization, thus making it available across the environment.
- Additionally, the Options for Entity section allows you to define some of the standard elements and behaviors that can be included with the entity. These are comprised of behavioral settings, data settings, and configurations for mobile and Outlook. These settings give you a granular access to configure how an entity can interact with the system and other entities, what processes can be run against this entity, and storage options for related files.
- Before clicking on the Save icon, direct your attention to the second tab named Primary Field. All entities will need to have a primary field, and we can define the properties of such fields on this tab. We will define the display name as
Country
, leave the Requirement Level with the default value Business Required, and the Type as Single Line of Text. - Now we click on Save.
- Once the entity is created, additional options to edit Forms, Views, Fields, and Relationships become available.
- Great job! Now we have the entity created and we can start working with it.
Removing an entity that is not being used by our customization is again a relatively simple task.
- In our solution package, select the entity.
- Click on the Delete button.
How it works...
Each entity is stored in the database as a set of two tables. The first one stores the base entity, while the second one stores the customizations to the entity. Creating a new entity in fact creates this set of tables, one that stores the entity generic properties, and another that stores each data fields defined. So, in our case, we will have a table called new_countryBase
, and another called new_countryExtensionBase
, as seen in the following two images:

The extended table has the following definition:

This information is only available while working On-Premise. With a Dynamics CRM 2011 Online instance, there is no direct access to the database.
Making modifications directly to the database in Dynamics CRM 2011 is not supported. This can cause various issues. All data access should go through web services. When creating custom reports, use the views. They also present the trimmed data security.
See also
- Additional information related to entities can be found on TechNet at http://technet.microsoft.com/en-us/library/gg309396.aspx.
- 新中國(guó)審計(jì)制度變遷
- Pentaho Business Analytics Cookbook
- 金融科技(FinTech)發(fā)展的國(guó)際經(jīng)驗(yàn)和中國(guó)政策取向(中國(guó)金融四十人論壇書(shū)系)
- Splunk:Enterprise Operational Intelligence Delivered
- Microsoft Dynamics NAV Financial Management
- Business Intelligence with MicroStrategy Cookbook
- Learning Microsoft Azure
- 非線性經(jīng)濟(jì)關(guān)系的建模
- OAuth 2.0 Identity and Access Management Patterns
- 2016年度注冊(cè)會(huì)計(jì)師全國(guó)統(tǒng)一考試專(zhuān)用輔導(dǎo)教材(圖解版):審計(jì)
- 新編統(tǒng)計(jì)學(xué)
- 成功通過(guò)PMP(第3版)
- 中國(guó)審計(jì)市場(chǎng):制度變遷與競(jìng)爭(zhēng)行為
- 政策建模技術(shù):CGE模型的理論與實(shí)現(xiàn)
- Oracle Primavera Contract Management,Business Intelligence Publisher Edition v14