Creating a Window Navigation Rule
- Logon to CRM.
- Navigate to Settings>>Window Navigation Rules
- Click “New” and fill 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 advance find and then download the xml. The highlighted part in the xml [[cti.telephone1]] represents the parameter passed as query string by 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 the form with 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 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 the form with 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 windows navigation rule record. This action will open a USD search screen with 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 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 found the matching contact, system will display the contact record and starts 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 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 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 and pass the customer id to USD and create the session. I am just exploring USD and rather create my custom search control in USD.
Please keep the suggestions coming.