Messaging integrations are very common in enterprise deployments, where reliability and scalability are highly demanded. This projects shows a simple custom messaging solution in Microsoft Dynamics CRM using standard development components of this platform.
As our initial technical requirement, we have assumed that the Microsoft Dynamics CRM application needs to send the new customers to “System X” and “System X” is going to send the new competitors to CRM.
These operations have been implemented with the XML messages “NewCustomer” and “NewCompetitor”, see below the schema definition (XSD).
Between CRM and “System X”, we assume there would be another system which acts as the channel to transport these messages. This articles doesn’t cover the details of how this middle tier should be implemented, since we could write a book only about that. Ideally,
I would recommend a message queue platform.
With those elements in mind, we have the next picture:
CRM Solution Components
a solution package, which can be exported and imported between environments as a ZIP file.
In our current implementation, the CRM solution package contains the next main components:
- “Message” entity. The Message entity holds the XML message to be sent or received. “Message Direction” is a custom attribute to indicate the message direction (IN/OUT)
Notes: Microsoft Dynamics CRM implements a relational data model based on SQL server, where each entity is a SQL table.
- “Message Processor” workflow. When a new message record is created, this workflow is run and it processes the message, reading the XML message and triggering the corresponding actions.
- “Process Message” custom Workflow Activity. The “Message Processor” workflow above described uses this customer workflow activity to instantiate the corresponding actions. This custom workflow activity is part of the assembly “DynCRMMessaginIntegration.Workflow”
The next screenshot shows the actual CRM solution that you can download from Codeplex. As you can see, it contains another workflow “Send New Contact-Customer Message”. This workflow creates a new message record after a new CRM contact has been created.