1
votes

I am working with a client application which was written to interface with Dynamics 4.0. It now needs to support Dynamics 2011 as well.

All of the interfacing with the server is done via an instance of DynamicsCrm4.CrmService.

A colleague has implemented authentication for 2011, so there is now a connection set-up and an instance of IOrganizationService created.

The two classes DynamicsCrm4.CrmService and IOrganizationService appear to be analogous, i.e. they have the same methods, but they don't appear to inherit from a common interface. Is there a simple way to take advantage of the commonality to re-use the functionality without a complete re-write of the application?

1

1 Answers

2
votes

First off, all of the CRM 4.0 asmx web calls are still supported in on premise CRM 2011 (they may not be in the next version though, and are not supported in the online office 365 authentication)), so you should still be able to use the app as is.

But... if you wanted to use the new CRM 4.0 calls, without a complete rewrite, the best I can think of is creating your own CrmSevice (maybe call it CRM4To2011Service) that encapsulates and calls the IOrganizationService under the covers, but accepts all the CRM 4 method calls and parameters.

As long as it matches exactly the interfaces of the CRM 4 version, you should be able to do a find and replace, replacing the CRMService instantiations with your new CRM4To2011Service.