Wednesday, June 10, 2015

CTI integration between CRM USD and Microsoft Lync - Part 2

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

  1. Logon to CRM.
  2. Navigate to Settings>>Window Navigation Rules
  3. Click “New” and fill in the following fields

    Field Name Value
    Name LyncIntegration Route
    Order 1
    Hosted Control LyncCTIManager
    Direction Both

    image
  4. Save the record.
  5. Click + in the CTI search section of the form, as shown below, to create a new CTI Search record.

    image
  6. 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

    image
  7. 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)

  1. Under Single Match, in the Decision field, select Create Session, Load Match then Do Action.
  2. Under Single Match, in the Action field, click the search icon to select a value, and then click New.

    image
  3. 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]]

    image
  4. Save the "Action Call” record and return back to the windows navigation rule record.
  5. Under the Result area, fill the Destination, Target Tab and Show Tab field as shown in the screen shot below.

    image
  6. Save the window navigation rule record.

No Matches (No contact is found)

  1. Under No Matches, in the Decision field, select Do Action.
  2. Under No Matches, in the Action field, click the search icon to select a value, and then click New.

    image
  3. 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

    image
  4. 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.
  5. 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

  1. Logon to USD.
  2. Ring the Lync number.
  3. 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

    image
  4. 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.

    image
     

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.

3 comments:

  1. Hi.

    Thanks for great article.

    I have the same problem figuring out how to display multiple matches. Did you found a solution for this? I think that probably it will be necessary to run the fetchXml query again and that displaying of matched records from rule is not possible

    Gregor H.

    ReplyDelete

  2. Microsoft CRM Consulting – Get high quality and affordable Microsoft CRM integration and development services around the world with 24x7 supports.

    ReplyDelete
  3. I have an issue completing the configuration steps, when i choose LyncCTIManager in the route logic the results tab options become hidden and i am unable to edit in the (destination, target tab and show tab)

    ReplyDelete