Using DynamicEntity to Access Entities at Runtime

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

One advantage to using the strongly typed Web Services Description Language (WSDL) is that you can discover and fix many code problems at design time instead of waiting until run time. However, you may want to write code that accesses entities that are not yet defined. For example, if you write a custom search utility using WSDL, you can only include entities in your search UI that exist in the WSDL that you add to your solution. To work with entities that do not exist at design time, the SDK includes dynamic entity support that does not require regeneration of the WSDL when schema changes are made.

The DynamicEntity class is derived from the BusinessEntity class, which lets you program against an entity type without having the full definition of the entity in the available WSDL. The DynamicEntity class contains the logical name of the entity and an array of properties for the entity attributes. You can write code that uses this information to work with entities that may not be defined at compile time. If you write code that is looking for an entity that does not exist at run time, an exception is thrown.

See Also

Concepts

Tasks

© 2010 Microsoft Corporation. All rights reserved.