Relationships in Microsoft Dynamics 365 define how entities are linked to one another (see Microsoft Create and edit entity relationships). Data in Dynamics is organized like the data in a relational database so you have a set of entities and there are relations between these entities. Fields in a given entity contain data to link a record to another record. For example, an Account is likely to be linked with a Contact. Instead of replicating the whole Contact data into the Account entity, there is a relationship between the two called account_primary_contact which links the two entities together. Coveo Cloud can index this additional information to make it searchable and retrievable using a simple query.
Indexing a Relationship
If an entity includes a relationship, Coveo Cloud appends the fields included in the relationship to the item before adding it to the index.
The relationship account_primary_contact links a Contact to an Account. When Coveo Cloud indexes the entity Account, the crawler detects the relationship and checks which fields are included in the relationship:
dyprimarycontactEmailto the Coveo index item Account along with the field
dyPrimaryContactIdString which contains the name of the Contact entity.
Dynamics fields names are modified prior to indexing to prevent any conflict caused by two fields bearing the same name (see Fields Mappings Between Dynamics 365 and Coveo Cloud).
You can add relationships via the Define Relations panel in the Source Properties panel (see Add/Edit a Microsoft Dynamics 365 Source Panel). Some relationships are included by default when you create a Dynamics source (see Relationships Ind).
When you configure a source, for each relationship you must specify:
- At least one field to index
- The relationship alias
What Is an Alias?
The alias is a prefix added to the relationship fields to avoid any conflict with the item fields.
For example, most entities include a field named Name. The alias allows the field Name coming from the relationship to coexist with the item field Name as they bear a different name.The alias you choose should be relevant to the relationship it stands for.
The relationship account_primary_contact on the Account entity has the Alias