Sunday, February 15, 2009

Working with Dynamic Entity

The DynamicEntity feature lets you generically access the data in any attribute on any entity in the system. In order to develop against the Microsoft CRM SDK, you must generate and consume a WSDL during code compilation. Because you must do this against a specific instance of the application, the only entities available are the core set included in the initial installation of Microsoft CRM. The WSDL does contain entity and attribute customizations but it is recommended that your code works with a clean installation. See Using the Microsoft CRM WebServices.

The DynamicEntity class is also used in plug-ins / callouts so that your callout code can work generically with any attribute on any entity without a re-compile.

The DynamicEntity class does not provide a name-base indexer, however, you can write your own. A simple approach to this problem is to loop through the dynamic entities property bag until you find the appropriate property.

No comments: