ustomer Relationship Management (CRM) plays a major role in today's competitive business industry. Imagine how frustrated you would feel if you were to get a call from customer support at a bank where you already hold a credit card asking you...if you're interested in applying for a credit card! Microsoft's Dynamics CRM (MSCRM) is a software package that helps avoid such problems by uniquely identifying your customers and tracking your organization's interactions with them. This article presents an overview of MSCRM Callout and how you can implement it in your applications.
Callouts are also called "Business Logic Extensions." They help developers using MSCRM execute business logic, either before or after a published event has occurred. Callouts are useful when you want to integrate MSCRM with other systems, such as SharePoint, or other ERP systems. There are two types of callouts: pre- and post-callouts. A pre-callout fires just prior to the occurrence of an event, while a post-callout fired just after the event occurs.
Callouts consist of two parts:
- A callout configuration file
- A callout assembly
The callout configuration file contains callout definitions.
|Author's Note: You must save all your callouts in a file named callout.config.xml.
Another requirement for callouts is that they must be able to validate against an XML schema file. Listing 1
shows the callout schema.
Fortunately, a typical callout config file is considerably simpler than the schema; here's an example:
<callout.config version="1.0" xmlns="
<callout entity="lead" event="PostUpdate">
In the preceding code, the <callout>
node defines the entity name (lead
) and the event (PostUpdate
) for this callout, meaning that this callout will fire after a Lead record gets updated in MSCRM.
The child <subscription>
node defines an assembly and a class name from a DLL containing custom business logic that you want to run when the callout fires.
child nodes define values passed to the callout method.
Creating or Updating Callout Configuration files
You have to be very careful when creating or updating the callout configuration file. More often than not, the configuration file ends up being the root cause for many common callout errors. Here are few points to remember when you're creating or modifying the configuration file:
- When you first install MSCRM, no callout configuration file exists; you have to create the file manually.
- Because there is only one callout configuration file (callout.config.xml) for all the callouts, it quickly becomes important to keep the callout configuration file under some sort of version control, such as VSS, TFS, Subversion, and so on.
- Prevalue and postvalue nodes in the callout config file are used only by Post callouts.
- MSCRM passes only non-null values to the callout even if you specify that it should to pass all values (using @all as in the preceding example).
- In the prevalue and postvalue nodes, specify only those columns that you need in callout code. Specifying unnecessary columns will send large amounts of XML data as input to the callout methods and hence will hinder performance.
- MSCRM lets you to associate any number of callouts with an event. However, it's not possible to write more than one callout method for an event in one class.
- Changes you make to the configuration file do not effect until you restart IIS.