Add or Edit a Microsoft Dynamics 365 Source

Microsoft Dynamics 365 is a customer relationship management typically used by support agents. A Microsoft Dynamics 365 source allows you to index any type of Dynamics entities, including support cases and KB articles. It also supports the Dynamics security scheme so that in the search results, users can only see the items they have access to in Dynamics (see Coveo, Dynamics, and Security).

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

Source Key Characteristics

Features Supported Additional information
Microsoft Dynamics 365 Cloud version

9

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 operations Refresh

Takes place every hour by default. Auditing must be enabled to take account of deleted items.

Rescan
Rebuild
Content security options Determined by source permissions
Source creator
Everyone

Add or Edit a Microsoft Dynamics 365 Source

When adding a source, select the Microsoft Dynamics 365 option.

To edit a source, on the Sources page, click the desired source, and then, in the Action bar, click Edit.

“Sign in to Microsoft Dynamics” Window

When adding a source, you must first authenticate with Microsoft Dynamics 365 in the Sign in to Microsoft Dynamics window to allow Coveo Cloud to access your content.

  1. Enter your Microsoft Dynamics 365 instance URL, and then click Sign In.

  2. Select a user that’s both a Microsoft Dynamics 365 administrator and an Azure1 administrator, and then enter the corresponding password.

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

1: Coveo is a verified publisher for the Azure application.

“Configuration” Tab

In the Add/Edit a Microsoft Dynamics 365 Source panel, the Configuration tab is selected by default. It contains your source’s general and authentication information, as well as other parameters.

General Information

Source Name

Enter a name for your source.

A source name can’t be modified once it’s saved, therefore be sure to use a short and descriptive name, using letters, numbers, hyphens (-), and underscores (_). Avoid spaces and other special characters.

Discovery Web App URL

Enter the Discovery Web App 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 don’t 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.

Organization Unique Name

Enter the Microsoft Dynamics 365 unique name identifying your organization. This name also appears on the Developer Resources page.

“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 for details on how to structure your configuration.

“Queries to Include” Section

Enter Microsoft Dynamics 365 FetchXML queries in execution order to index specific content. See Queries to Include Reference for details on how to structure your configuration.

“Content Security” Tab

Select who will be able to access the source items through a Coveo-powered search interface. For details on this parameter, see Content Security.

“Access” Tab

In the Access tab, determine whether each group and API key can view or edit the source configuration (see 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.

Completion

  1. Finish adding or editing your source:

    • When you want to save your source configuration changes without starting a build/rebuild, such as when you know you want to do other changes soon, click Add Source/Save.

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

      OR

    • When you’re done editing the source and want to make changes effective, click Add and Build Source/Save and Rebuild Source.

      Back on the Sources page, you can review the progress of your source addition or modification.

    Once the source is built or rebuilt, you can review its content in the Content Browser.

  2. Optionally, consider editing or adding mappings.

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

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 (isn’t like), In (is included in), NotIn (isn’t included in), Null (contains data), and NotNull (doesn’t 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 doesn’t need to match the Microsoft Dynamics 365 entity name, as it’s 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.

Example: customerid

toField (String)

The primary key identifying the related entity from which you want to index some metadata.

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?

Adapt the source update schedule to your needs.

Recommended Articles