Edit a Microsoft Dynamics 365 Source

Microsoft Dynamics 365 sources are created in your Coveo Cloud organization and managed by Coveo for Microsoft Dynamics 365 (see What Is Coveo for Microsoft Dynamics 365? and Installing Coveo for Microsoft Dynamics 365). A Microsoft Dynamics 365 source supports the Microsoft Dynamics 365 security scheme so that in the search results, users can only see the items they have access to in Microsoft Dynamics 365 (see Coveo, Dynamics, and Security). By default, a Microsoft Dynamics 365 source starts a refresh every hour to retrieve Microsoft Dynamics 365 item changes (addition, modification, or deletion).

In the Coveo Cloud administration console, members of the Administrators and Content Managers built-in groups can view the Microsoft Dynamics 365 source edition panel where they can modify the mappings (see Administration Console).

Source Features Summary

Features Supported Additional information
Microsoft Dynamics 365 version

8.0 +

See Microsoft Dynamics CRM / Dynamics 365 Updates.
Searchable content types

All available systems entities and custom ones, notes, and files attached to records of included entity types, and KB articles (body, comments, attachments).

Content update Refresh

Auditing must be enabled to retrieve deleted items. [more]

Rescan
Rebuild
Content security options Secured
Private
Shared

Add a Microsoft Dynamics 365 Source

  1. In the Add a Source of Searchable Content panel, click Microsoft Dynamics 365 (see Add a New Source).

  2. In the Sign in to Microsoft Dynamics window that opens, enter your Microsoft Dynamics 365 instance URL, and then click Sign In.

  3. Pick a user that is both a Microsoft Dynamics 365 administrator and an Azure administrator, and then enter the corresponding password.

  4. Click Accept to allow Coveo to access your Dynamics 365 content.

  5. Under Source Name, enter a name for your source.

  6. Under Discovery Web App URL, enter the Discovery Service URL of your Microsoft Dynamics 365 instance to be used as the endpoint to connect to the web services used to communicate with the Microsoft Dynamics 365 cloud components.

    If you do not know your Discovery Web API URL, follow these steps to access this information:

    1. In the Microsoft Dynamics 365 expandable navigation panel at the top, navigate to Settings > Customization > Customizations.
    2. In the Customization page, click Developer Resources.
    3. Your Discovery Web API endpoint address appears under Connect your apps to the Dynamics 365 Discovery Service.
  7. Under Organization unique name, enter the Microsoft Dynamics 365 unique name identifying your organization. This name also appears in the Developer Resources page.

  8. Under Security, select a content security option to determine who can see items from this source in a search interface.

  9. Under Entities to include and/or Queries to include, enter a configuration defining the Microsoft Dynamics 365 content your want to retrieve. Both sections are considered when retrieving your content, so you can enter a configuration in one or both boxes.
    • In the Entities to include section, enter a JSON configuration defining the Dynamics entities and fields to index. You can also specify conditions and relations between entities (see Entities to Include Reference).
    • In the Queries to include section, enter Microsoft Dynamics 365 FetchXML queries in execution order (see Queries to Include Reference).
  10. In the Access tab, determine whether each group and API key can view or edit the source configuration (see Understanding Resource Access):
    1. In the Access Level column, select View or Edit for each available group.
    2. On the left-hand side of the tab, if available, click Groups or API Keys to switch lists.

      If you remove the Edit access level from all the groups of which you are a member, you will not be able to edit the source again after saving. Only administrators and members of other groups that have Edit access on this resource will be able to do so. To keep your ability to edit this resource, you must grant the Edit access level to at least one of your groups.

  11. Optionally, consider editing or adding mappings between Microsoft Dynamics 365 item metadata and fields in your Coveo Cloud organization (see Adding and Managing Source Mappings).

    You can only manage mapping rules once you build the source (see Refresh, Rescan, or Rebuild Sources).

  12. Complete your source addition:

    • Click Add Source when you want to save your source configuration without launching a build, such as when you know you want to do other changes soon.

      On the Sources page, you must click Start initial build or Start required rebuild in the source Status column to add the source content or make your changes effective, respectively.

      OR

    • Click Add and Build Source when you are done and want to make changes effective.

      Back on the Sources page, you can review the progress of your Microsoft Dynamics 365 source addition (see Adding and Managing Sources).

    Once the source is built, you can review its content in the Content Browser (see Content Browser - Page).

Entities to Include Reference

Your JSON configuration should be formatted as follows. Each object in this configuration represents a type of Microsoft Dynamics 365 entity to index.

[
...
  {
    "name": "entityTypeName",
    "conditions": [
      {
        "field": "fieldName",
        "operator": "Equal",
        "type": "STRING",
        "values": [
          "name"
        ]
      }
    ],
    "fields": [
      {
        "name": "fieldName"
      }
    ],
    "relations": [
      {
        "name": "linkedEntityTypeName",
        "fields": [
          "fieldName"
        ],
        "fromField": "sourceObjectField",
        "toField": "targetObjectField",
        "toObject": "linkedObjectName"
      }
    ]
  },
...
]

name (string, required)

The type of the Microsoft Dynamics 365 entity to index.

Example: account

conditions (array of object)

Each object in this array represents a condition that an entity must meet to be indexed.

Example:

"conditions": [
  {
    "field": "address1_country",
    "operator": "Equal",
    "type": "STRING",
    "values": [
      "canada",
      "mexico"
    ]
  },
  {
    "field": "address1_addresstypecode",
    "operator": "Null",
    "type": "UNARY"
  },
  {
    "field": "address2_latitude",
    "operator": "GreaterThan",
    "type": "NUMBER",
    "values": [
      "42"
    ]
  }
]

field (string)

The Microsoft Dynamics 365 field on which the condition is based.

operator (string)

The condition operator.

Available operator options are: Equal, NotEqual, GreaterThan, GreaterEqual (is greater than or equal to), LessThan, LessEqual (is less than or equal to), Contains, DoesNotContain, BeginsWith, DoesNotBeginWith, EndsWith, DoesNotEndWith, Like (is like), NotLike (is not like), In (is included in), NotIn (is not included in), Null (contains data), and NotNull (does not contain data).

type (string)

The type of data specified under values.

Available types are: STRING, NUMBER, and UNARY.

UNARY indicates that no values are expected for this condition (e.g., with the Null operator).

values (array of string)

The field values to put in relation with the operator.

fields (array of object, required)

Each object in this array is the name of a metadata field to index for the desired entity. Specify at least one field.

Example:

"fields": [
  { "name": "accountid" },
  { "name": "name" }
]

relations (array of object)

Each object in this array represents a Microsoft Dynamics 365 entity related to the indexed entity.

Example:

"relations": [
  {
    "name": "customeraccount",
    "fields": [
      "name",
      "modifiedon",
      "websiteurl"
    ],
    "fromField": "customerid",
    "toField": "accountid",
    "toObject": "account"
  }
]

name (string)

A string identifying the type of related entity. This does not need to match the Microsoft Dynamics 365 entity name, as it is only for identification purposes.

Example: customeraccount

fields (array of string)

The names of the metadata fields to retrieve from the related entity.

Example:

"fields": [
  "name",
  "modifiedon",
  "websiteurl"
]

fromField (string)

In the entity to retrieve, the foreign key identifying the related entity from which you want to index some metadata (see SQL Join).

Example: customerid

toField (string)

The primary key identifying the related entity from which you want to index some metadata (see SQL Join).

Example: accountid

toObject (string)

The type of entity to retrieve, as displayed in Microsoft Dynamics 365.

Example: account

Queries to Include Reference

Your FetchXML configuration should be formatted as follows. You can enter more than one query. If you do, queries will be executed in the order they appear in the configuration.

<queries>
  <query>
    <id>active-cases</id>
    <name>Active Cases</name>
    <queryXml>
    <fetch>
      <entity name="incident"></entity>
    </fetch>
    </queryXml>
  </query>
</queries>

id

A unique string identifying your query.

name

A name identifying your query for troubleshooting purposes.

queryXml

The FetchXML query to execute to retrieve the desired content (see Use FetchXML to construct a query).

What’s Next?

Review your source update schedule and optionally change it so that it better fits your needs (see Edit a Source Schedule). By default, your content is refreshed every 15 minutes.