This is the second part of the blog
CTI integration between CRM USD and Microsoft Lync - Part 1. The last blog covered how to receive the CTI event in USD. In this blog we will use the telephone number provided by the CTI system to pop up a customer record in USD. To achieve this we have to create a windows navigation rule record.
Creating a Window Navigation Rule
- Logon to CRM.
- Navigate to Settings>>Window Navigation Rules
- Click “New” and fill in the following fields
Field Name | Value |
Name | LyncIntegration Route |
Order | 1 |
Hosted Control | LyncCTIManager |
Direction | Both |
- Save the record.
- Click + in the CTI search section of the form, as shown below, to create a new CTI Search record.
- Fill the form with the following values as shown below.
Field Name | Value |
Name | LyncIntegration ContactSearch |
Order | 1 |
FetchXML | <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="contact">
<attribute name="fullname" />
<attribute name="parentcustomerid" />
<attribute name="telephone1" />
<attribute name="emailaddress1" />
<attribute name="contactid" />
<order attribute="fullname" descending="false" />
<filter type="and">
<condition attribute="telephone1" operator="eq" value="[[cti.telephone1]]" />
</filter>
</entity>
</fetch> |
To create the fetchxml use the advance find functionality in CRM and then download the xml. The highlighted part in the xml [[cti.telephone1]] represents the parameter passed as a query string by the LyncConnector middleware application
- Save the record and return back to windows navigation rule.
Based on the result of the CTI Search, we can configure the behaviour of the windows navigation rule.
Single Match (Single contact is found)
- Under Single Match, in the Decision field, select Create Session, Load Match then Do Action.
- Under Single Match, in the Action field, click the search icon to select a value, and then click New.
- It will open up a new “Action Call” record. Fill this form with the following values:
Field Name | Value |
Name | LyncIntegration Open Contact |
Hosted Control | CRM Global Manager |
Action | Open CRM Page |
Data | Id=[[$Context.Id]]
LogicalName=[[$Context.LogicalName]] |
- Save the "Action Call” record and return back to the windows navigation rule record.
- Under the Result area, fill the Destination, Target Tab and Show Tab field as shown in the screen shot below.
- Save the window navigation rule record.
No Matches (No contact is found)
- Under No Matches, in the Decision field, select Do Action.
- Under No Matches, in the Action field, click the search icon to select a value, and then click New.
- It will open up a new “Action Call” record. Fill this form with the following values:
Field Name | Value |
Name | Search Contact Action Call |
Hosted Control | Search |
Action | Find |
Data | contact |
- Save the "Action Call” record and return back to the windows navigation rule record. This action will open a USD search screen with the contact tab selected.
- Save the windows navigation rule.
Multiple Matches
I did not find a way to display multiple results. I will try to come up with a custom hosted control in the future. If anyone has any idea please let me know.
Testing the Integration
- Logon to USD.
- Ring the Lync number.
- If everything is working properly and system has found the matching contact, the system will then display the contact record and it will start a session as shown in the screen shot below
- If no contact is found with the matching number USD will display the search screen with the contact tab selected as shown in the screen shot below. There is an issue with this solution; USD does not set the focus on the “Search” tab.
Where to From Here
This is the simplest example of the integration. The middleware built in this blog is just posting the URL on a generic listener port. It can be modified to send Lync chat and contact information.
Going forward, middleware can be used to retrieve the interaction history from Lync and create CRM records as required.
Some people suggested to process the call in the LyncConnector, pass the customer id to USD, and create the session. I am just exploring USD and would rather create my custom search control in USD.
Please keep the suggestions coming.