Microsoft BizTalk Adapter for Microsoft Dynamics CRM


                                    Microsoft Dynamics CRM
  1. Download the .msi file from the Microsoft Download Center (http://www.microsoft.com/downloads/details.aspx?FamilyID=4628fca6-388d-45bc-a154-453b920dbcb8&DisplayLang=en).
  2. Double-click the .msi file. The Installation Wizard opens, to help guide you through the installation.
  3. After the installation is complete, Microsoft Dynamics CRM appears in the list of adapters in the BizTalk Server 2006 Administration Console, as shown in Figure 1. The BizTalk Server 2006 Administration Console is installed with Microsoft BizTalk Server 2006.
  4. User has to be local administrator and member of "SSO Administrators" group to perform the installation.



Creating a send port when the BizTalk Server process user is also the Microsoft Dynamics CRM access user

Follow these steps to create the send port when the BizTalk Server process is running under the credentials of a Microsoft Dynamics CRM access user.

1.      Click Start, point to Microsoft BizTalk Server 2006, open BizTalk Administration and expand Applications, and then expand BizTalk Application 1.
2.      Right-click Send Ports, point to New, and then select either Static One-Way Port or Static Solicit Response Port.
The Send Port Properties dialog box opens, as shown in Figure 2.
3.      In the Name box, type the name of the send port.
4.      In the Type list, select Microsoft Dynamics CRM.
5.      In the Send handler list, verify that the default BizTalkServerApplication is selected.
6.      In the Send pipeline list, select XML Transmit or, if you are using a two-way solicit response port, select XML Receive.
7.      Click OK.

Creating a send port when the BizTalk Server process user and the Microsoft Dynamics CRM access user are different


Follow these steps to create a send port when the Microsoft Dynamics CRM access user has different credentials than the BizTalk Server process user, or if you are configuring multiple send ports to multiple Microsoft Dynamics CRM servers.

This scenario has the following steps:

  1. Create the host.
  2. Create the host instance.
  3. Create the new send handler for the Microsoft Dynamic CRM adapter.
  4. Create the send port with the new send handler.

 Create the host

1.      Click Start, point to Microsoft BizTalk Server 2006, open BizTalk Administration, and expand Platform settings.
2.      Right-click Hosts, point to New, and select Host.
The Host Properties dialog box opens, as shown in Figure 3.
3.      In the Name box, type a host name.
4.      In the Type list, select In-Process.
5.      In the Windows group box, enter the name of the BizTalk Application Users or BizTalk Server Administrators group, and then click OK.

Create the host instance

1.      Click Start, point to Microsoft BizTalk Server 2006, open BizTalk Administration, and expand Platform Settings.
2.      Right-click Host Instances, point to New, and then click Host Instance.  The Host Instances Properties dialog box opens, as shown in Figure 4.
3.      In the Host name list, select a name.
4.      In the Server list, select a server.
5.      Click Configure. The Logon Credentials dialog box opens.
6.      In the Logon and Password boxes, type the domain logon name and password of the Microsoft Dynamics CRM access user. These are the credentials used for the host instance to run and for the send handler that will be created (as explained in the next procedure) for the Microsoft Dynamics CRM adapter under this host. Verify that this user is part of the BizTalk Application Users group.
7.      Click OK.




Create the new send handler for the adapter

1.      Click Start, point to Microsoft BizTalk Server 2006, open BizTalk Administration, and then expand Platform Settings.
2.      Expand the Adapters node, and then select Microsoft Dynamics CRM.
3.      Right-click Microsoft Dynamics CRM, point to New, and then click Send Handler. The Microsoft Dynamics CRM – Adapter Handler Properties dialog box opens, as shown in Figure 5.
4.      In the Host name list, select the host that you created in the previous procedure, and then click OK.
5.      To start (or restart) the host instance, right-click the host instance, and click Start (or Restart).


Create the send port with the new send handler

1.      Click Start, point to Microsoft BizTalk Server 2006, open BizTalk Administration and expand Applications, and then expand BizTalk Application 1.
2.      Right-click Send Ports, point to New, and then select either Static One-Way Port or Static Solicit Response Port.
The Send Port Properties dialog box opens, as shown in Figure 6.
3.      In the Name box, type a name for the send port.
4.      In the Type list, select Microsoft Dynamics CRM.
5.      In the Send handler list, select the host created in the previous procedure.
6.      In the Send pipeline list, select XML Transmit or, if you are using a two-way solicit response port, select XML Receive, and then click OK.




Fetch the schema

Follow these steps to fetch the entities or actions schemas from Microsoft Dynamics CRM.
1.      Click Start, point to Programs, point to Microsoft Visual Studio .NET, and then click Microsoft Visual Studio .NET.
2.      In Visual Studio .NET, on the File menu, point to New, and then click Project.
The New Project dialog box opens, as shown in Figure 7.
3.      In the Solution Explorer window, right-click BizTalk Server Project, point to Add, and then click Add Generated Items.
The Add Generated Items dialog box opens, as shown in Figure 8.
4.      Under Categories, select Add Adapter Metadata, and then click Add.
The Add Adapter Wizard opens, as shown in Figure 9.
5.      From the list of registered adapters, select Microsoft Dynamics CRM.
6.      In the Port list, select the port created in the previous procedure, and then click Next.
The Microsoft Dynamics CRM User Credentials dialog box appears, as shown in Figure 10.
7.      In the User Name and Password boxes, type the user name and password of the Microsoft Dynamics CRM user, and then click OK. The Microsoft Dynamics CRM Entities and Actions dialog box appears, as shown in Figure 11.
8.      Select the appropriate check box to open the list of entities or actions. Figure 12 shows an expanded list.
9.      Select the check boxes for all entities or actions for which schemas are to be fetched, and then click Next. Visual Studio Solution Explorer opens and displays the schemas of entities .




Run-time Behavior

The BizTalk Server Adapter for Microsoft Dynamics CRM processes the XML sent from BizTalk Server and performs the Create, Update, and Delete actions of any entities and all other possible actions supported in Microsoft Dynamics CRM based on the values present in the incoming XML.

There is an attribute named “crm_action” in the root node of entity and action schemas.

When the incoming XML (the transformed /mapped XML) comes to the BizTalk Server Adapter for Microsoft Dynamics CRM, if:
·         “crm_action” attribute is empty:
(1)   If the primary key node of the entity (for example accountid for Account) is not present in the XML or if the node has an empty value, the adapter assumes this is a “create” action.
(2)   If the primary key node of the entity has a correct GUID value, the adapter assumes the action to be “update”.
·         “crm_action” node contains some value:
(1)   If the action is “create”, “update” or “delete”, perform create, update and delete respectively.
(2)   If the action is “execute”, this adapter perform the other action requested using the Microsoft Dynamics CRM SDK. Some examples of actions are ConvertQuoteToSalesOrderRequest, ConvertProductToKitRequest, and SetStateAccountRequest. For a complete reference of all possible actions, see the Microsoft Dynamics CRM 3.0 SDK.

A special case: If you want to perform a create action where you specify the GUID for the entity. For example, you want to create an account where the account id is “{684FD04E-E515-491f-AF25-F9258A3C9F03}”.
Solution:
(1)   The input XML to the adapter (which can be the result of a map transformation) should contain the following nodes with the specified values.
(a)    <accountid> {684FD04E-E515-491f-AF25-F9258A3C9F03} </accountid>
(b)   crm_action=”create” [crm_action is an attribute.]

Create a secured log path directory 

You can use a debug feature to check whether the map used in the orchestration is generating the correct XML for Microsoft Dynamics CRM SDK.
This feature is toggled using a registry setting. When Debug = true in the registry, the adapter checks the values in the XML (which results from a transformation/map in orchestration) against all attributes of an entity and their permissible values.

Warning: Modifying the registry incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of the registry can be solved. Use the registry at your own risk.
If there are incorrect values in the XML, an error is logged in a log file that is created in a directory specified by the registry key “LogPath” in the same registry path where “Debug” is present.
Important: The registry path is “HKEY_CLASSES_ROOT\CLSID\{D38D5DCC-2B30-43b9-9C69-3BBFD0926986}”. This directory must be protected with the appropriate permissions and credentials so that only a user who has the appropriate credentials and permissions can create and access log files in this directory.


Support

Support for the Microsoft® BizTalk® Server 2006 Adapter for Microsoft Dynamics™ CRM 3.0 is limited to the areas outlined in this Installation and Usage Guide.  These areas include:

  • Installation
  • Creating Send Ports
  • Fetching Schema from Microsoft CRM

For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

Comments

Popular posts from this blog

Unit Testing In Biztalk 2009