Search data using entity searches in Unified Service Desk


Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2013, Dynamics CRM 2015, Dynamics CRM 2016

Entity searches are FetchXML definitions that query the Microsoft Dynamics 365 web services to return data. You can also use replacement parameters within the FetchXML queries in an entity search. Entity searches can be used in window navigation rules both as a source to access data which is not displayed on the form, and as a destination to look up the data using a web service call to Dynamics 365, and then populate the Unified Service Desk context data so that it can be used in replacement parameters. You can also use entity searches in the DoSearch action for the Global Manager hosted control to search for your data.

You define an entity search in the Entity Searches area (Settings > Unified Service Desk > Entity Searches) in Dynamics 365. To define an entity search, you need to specify three things: a name, the entity that the search applies to, and the FetchXML query that represents the query to retrieve data from the server.

The following FetchXML query returns name and address details of an account based on a customer ID available from a case:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="account">
    <attribute name="name" />
    <attribute name="emailaddress1" />
    <attribute name="telephone1" />   
    <attribute name="address1_line1" />
    <attribute name="address1_city" />
    <attribute name="address1_stateorprovince" />
    <attribute name="address1_postalcode" />
   <attribute name="address1_country" />
   <attribute name="msdyusd_facebook"/>
   <attribute name="msdyusd_twitter"/>
    <order attribute="name" descending="false" />
    <filter type="and">
      <condition attribute="accountid" operator="eq" value="{[[incident.customerid.Id]x]}" />

This is how the entity search definition looks like:

Sample entity search definition


While defining FetchXML queries in an entity search, you should only return the fields that are required for the purpose. This minimizes the impact on the network by limiting the size of the request and the data being returned, thus optimizing the resource usage.

Developers can also reuse an existing entity search definition in their code to search for records in Dynamics 365. More information:Reuse Entity Search definition in your custom code

See Also

Reuse Entity Search definition in your custom code
Use window navigation rules in Unified Service Desk
Action calls
Learn to use Unified Service Desk
Walkthrough: Use the generic listener adapter for CTI event routing

Unified Service Desk 2.0

© 2017 Microsoft. All rights reserved. Copyright