Using Entity Names

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

It is easy to confuse the schema name and logical name because the Web application customization forms use the label schema name for the logical name. Just be aware that after the entity or attribute is created, the SDK always uses the name in lowercase.

For example, the logical name of the Account entity is account. The logical name of a custom entity called Bank Account could be new_bankaccount.

The following table describes the various names for an entity.

Name Description
Display Name The entity name that is displayed to the user in the Web application and the Microsoft Dynamics CRM for Microsoft Office Outlook.
Display Collection Name A plural version of the display name.
Logical Name The name of the class created in the Web service that represents the entity. This name is all lowercase. If it is a custom entity, it has the prefix defined in the organization.schemanameprefix attribute.

For system entity names, you can use the EntityName enumeration.

Schema Name The schema name for an entity is used to create the logical name and the secured view. This name should use Pascal case.

For a description of Pascal case, see the .NET Framework Developer Guide Capitalization Conventions found at msdn2.microsoft.com/en-us/library/ms229043.aspx.

The following table shows examples of how to use names in the SDK.

Type, Class, or Enumeration Convention Example
System entity class name All lowercase. This is the logical name in the metadata.
account myaccount = new account();
Custom entity class name All lowercase with an underscore after the prefix defined in customization settings.
new_bankaccount myAcct = new new_bankaccount();
Attribute property name All lowercase. This is the logical name in the metadata.
account.name
account.new_creditrating
new_bankaccount.name
Message name Pascal case
CreateRequest
CreateResponse
SendEmailRequest
SendEmailResponse
State enumeration Pascal case
AccountState
References to entity names in Fetch and QueryExpression All lowercase. This is the logical name in the metadata.
QueryExpression accountQE = new QueryExpression ("account");
"<fetch mapping='logical'><entity name='account'><all-attributes/></entity></fetch>";
Filtered view name Pascal case
FilterdAccount
FilteredNew_BankAccount

See Also

Concepts

Reference

© 2010 Microsoft Corporation. All rights reserved.