Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Upgrade Issues for Workflow and Callouts

Upgrade Issues for Workflow and Callouts

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

Microsoft Dynamics CRM 3.0 custom extensions such as callouts and workflow assemblies that use the Microsoft Dynamics CRM 3.0 Web services can be seamlessly upgraded to Microsoft Dynamics CRM On-premise without having to recompile. Any previously registered NET assemblies that you have developed for Microsoft Dynamics CRM 3.0 will continue to work after you upgrade the system to Microsoft Dynamics CRM 4.0. Upon upgrade, the configuration information for the Microsoft Dynamics CRM 3.0 workflow is added to the database but the supporting files remain on the server.

Callout Upgrade Considerations

In Microsoft CRM 3.0, callouts were instantiated every time they were invoked. Class-level variables defined in the callout would not be shared across multiple instances of the callout class, since Microsoft CRM would allocate memory for each instance of the callout and dispose it after callout execution completed. Because Microsoft Dynamics CRM 4.0 caches plug-ins and callouts, and reuses them across multiple threads, data corruption of these class variables can occur.

There are two recommended methods of working around this issue:

·Do not use class level variables in callouts or pass the data you need to the callout in the entityXml parameter of the callout.

·Implement a proxy class that makes the callout stateless. After you have created the proxy class, remember to change the callout.config.xml file to point to the new proxy class.

The following shows sample code for a proxy class.

public class MyCalloutProxy : CrmCalloutBase
   public override PreCalloutReturnValue PreUpdate(CalloutUserContext userContext,
      CalloutEntityContext entityContext,  ref string entityXml, ref string errorMessage)
      MyCallout currentOne = new MyCallout();
      return currentOne.PreUpdate(userContext, entityContext, ref entityXml, ref errorMessage);


For existing Microsoft Dynamics CRM 3.0 callouts and workflow assemblies to function in the new multi-tenant environment, a default organization has been implemented. When executed under Microsoft Dynamics CRM, legacy custom components and assemblies will be redirected to the Web service WSDL and endpoints of the default organization.

The default organization is defined by the system administrator and is usually set to organization that was used under Microsoft Dynamics CRM 3.0. This is done during the upgrade process.

The Microsoft Dynamics CRM 3.0 CrmService Web service can be found at the following URL:


The Microsoft Dynamics CRM 3.0 MetadataService Web service can be found at the following URL:


State Changes for Entities

Set state events on some entities will no longer fire when they are upgraded to Microsoft Dynamics CRM 4.0. For example, on the incident (case) entity, Microsoft Dynamics CRM 4.0 fires a CloseIncident message when an incident (case) is resolved and a SetStateDynamicEntity message when a case is canceled or reactivated.

You need to unregister your upgraded callout from the SetStateIncident message and then register it against the CloseIncident message or the SetStateDynamicEntity message, or both messages depending on your functionality.

The following table lists all the state change events that work differently in Microsoft Dynamics 4.0.

UI actionEntity3.0 event4.0 event4.0 message
Canceling a contractcontractSetStateCancelCancelContract
Closing a caseincidentSetStateCloseCloseIncident
Closing an opportunityopportunitySetStateWin






Closing a quotequoteSetStateClose






Fulfilling an ordersalesorderSetStateCreate




Canceling an ordersalesorderSetStateCancelCancelSalesOrder

See Also


Other Resources

© 2010 Microsoft Corporation. All rights reserved.

© 2015 Microsoft