Working with Dynamic Entities in CRM 4.0

by Bill Owens 4. August 2008 22:52
Mitch Milam's Microsoft Discussions wrote this

Working with Dynamic entities is a bit different in 4.0 vs. 3.0.  When writing plug-ins and using Microsoft.Crm.Sdk, you have the ability to access the attributes of a Dynamic Entity via a property bag, much like this:

DynamicEntity updateEntity = new DynamicEntity("m3_roundrobin"); updateEntity["m3_lastuserid"] = newOwner.ToString(); updateEntity["m3_teamid"] = teamId.ToString();

However, if you're writing an application that used the standard CRM web service, this methodology is not available to you, so you have to resort to the more code-intensive methods we used in CRM 3.0

Fortunately, if you look deep into the CRM SDK, you'll find a solution to this issue.

After installing the CRM 4.0 SDK, browse to this folder:

\sdk\server\helpers\cs\crmhelpers

and look for the following file:

dynamicentitypartialtype.cs

If you add this file to your Visual Studio project, you will have the same Dynamic Entity property bag capability using the CRM web service as you do when using the Microsoft.Crm.Sdk assembly.

I was pleasantly surprised when I located the code and it has made working with Dynamic Entities much easier.

 

Have a great weekend everyone.

Tags: , ,

CRM 4.0

Page List

About the author

I work for a consulting firm in Dublin Ohio called Affiliated Resource Group. For the last five years I have been spearheading our Microsoft Dynamics CRM practice. I have a deep appreciation for the Microsoft CRM platform and I am very excited about it. You might even describe me as a Microsoft CRM Advocate. I have many battle scars from my experience with the product and I’m constantly being asked questions about CRM and how-to-do something in it. Hence, this BLOG is to help disseminate that knowledge and information to everyone. As of last year I was posting links to many other blogs to help spread the knowledge, but now with the community.dynamics.com doing that for me, I will be following that practice unless a really juicy article catches my eye. Many people have asked where my post are for the first half of 2010, my company had me posting to another blog and maintain two was near impossible. I am now down to just this blog. So good luck and I hope that this blog may help in some way. If you have suggestions or questions, please email me them.

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2012 BillOnCRM