Experience your
30 day trial
now!
GET STARTED
You may have noticed that the Microsoft Dynamics CRM 4.0 SDK contains Web services, assemblies and helper code that have LOTS of the same classes. Which should you use, when and why? It depends on what you are creating:
A plug-in is an assembly that it registered to run before or after CRM does it’s processing for an action.
Use:
Use the SDK assembly because contains the IPlguin and IPluginExecutionContext. It also contains the helper classes you can use for building queries, instantiating types and enumerations you can use to make your code more readable and maintainable.
Use the SDK type proxy assembly because it contains the messages (request and response classes). This assembly also includes all the entity classes but do not use them! In other words, do not use the account or contact classes; instead use the DynamicEntity class, which provides a property bag to access the attributes of an entity instance (record). This is better for you anyway, since the entity classes included in this DLL will not contain any of your customizations. The entity classes are deprecated and will be removed from this assembly in a future version.
Custom workflow activities are assemblies that can be called from a workflow.
Use the SDK assembly because it contains the Workflow namespace which includes all the classes you need to create custom workflow activities.
You can use the messages (request and response classes) contained in the SDK type proxy in your custom workflow activities. The same warning against using the entity classes applies here.
If you are adding new functionality to the CRM Web application or to the Outlook client, you should use the Web services. This includes adding custom ASPX pages or adding ISV menu items that calls your custom code. Remember that if you customize your entities, you need to recompile any code that uses those customized entity classes.
There is another Web service covered in the CRM Deployment SDK but this is not used in this sort of custom code.
If you are adding functionally to the CRM Outlook client, use the Outlook SDK assembly because it contains methods to detect whether the client is online or offline, to make the client go online or offline or to synchronize the data after going online.
You can also use the helper classes by adding the C# files from CrmHelpers. These classes can be used for easier type instantiation, for building queries and contains enumerations you can use to write more readable and maintainable code.
You can also get the identical helper classes by adding the Microsoft.Crm.Sdk.dll assembly. Adding this DLL requires a bit more care because the SDK assembly contains the classes for the metadata Web service so this may be confusing if you are also using the MetadataService.
Do not include Microsoft.Crm.SdkTypeProxy.dll to these types of projects. The Web services contain the entity classes and the message classes so this assembly is not needed.
Read about these topics in the SDK:
Amy Langlois
PingBack from http://wordnew.acne-reveiw.info/?p=1989
Can I use CrmService (custom entities and customized entities) in Plugins? Plugins can be parts of ISV solution code too! In other words, I don't understand, why I should use dynamic entity only in Plugins.
Okay, so I'll give you a baker's dozen of some really good stuff from the perspective of a Microsoft