Making Dynamics Content Available in a Microsoft Portal

By default, when integrated in Dynamics, Coveo for Microsoft Dynamics 365 secures Dynamics content and presents search results in accordance with the CRM security model (see Coveo Cloud V2 Management of Security Identities and Item Permissions). Therefore, the search results presented to a Dynamics user consist of only the items they are allowed to see.

However, Microsoft portals have their own security model, which may differ from the security model of the Dynamics instance powering the portal. For instance, your customer support agents may be able to see and edit all support cases when authenticated in Dynamics, and you might want to allow your customers to review the cases they opened when logged in to your portal. As a result, the search results returned by Coveo for Microsoft Dynamics 365 in a Microsoft portal must comply with the portal security model as well.

This article explains how to edit a Microsoft Dynamics 365 source to take portal permissions into account and how to ensure portal users will be able to access your Dynamics content.

Configuring Your Source

By default, a Microsoft Dynamics 365 source does not take portal permissions into account. You must therefore configure your source to do so.

  1. If not already done, in Coveo for Microsoft Dynamics 365, create a Microsoft Dynamics 365 source (see Creating a New Source).
  2. In the Coveo for Microsoft Dynamics 365 configuration menu on the left, click Administration Console to open the Coveo Cloud administration console (see Coveo Cloud V2 Administration Console).
  3. In the menu on the left-hand side of the page, under Content, click Sources.
  4. In the Sources page, select your Microsoft Dynamics 365 source, in the Action bar, click More, and then Edit JSON.
  5. In the Edit a Source JSON configuration panel, in the source JSON configuration, locate the parameters object (see Edit the JSON Configuration).
  6. Add the following properties to the parameters object:

     "AddPortalSecurities": {
         "sensitive": false,
         "value": "true"
         },
     "PortalSites": {
         "sensitive": false,
         "value": "{MyValue}"
         },
    
  7. In the parameters JSON configuration you just added, under PortalSites, enter the appropriate value for the value parameter:
    1. Access the following URL, in which you replace {DynamicsURL} with your Dynamics instance root URL, such as example.crm.dynamics.com: {DynamicsURL}/api/data/v9.0/adx_websites?$select=adx_websiteid,adx_name,adx_primarydomainname
    2. In the JSON returned, if you have more than one portal, locate the target one.
    3. Copy the corresponding adx_websiteid value, and then paste it in your source JSON configuration in place of {MyValue}.
  8. Click Save and Rebuild Source.

Adding a Portal URI Field

Typically, in Coveo for Microsoft Dynamics 365 search pages, when a user clicks the title of a Dynamics search result, they are redirected to this item.

A Dynamics user searches for accounts. They are interested in account City Power & Light, so they click the title of this search result.

Clicking City Power & Light in an Dynamics search page

They are then redirected to the City Power & Light account page.

City Power & Light account page

When Coveo for Microsoft Dynamics 365 is used for searches within Dynamics only, the Dynamics items returned in the search results have a URI specifically for internal access. This means that users interested in a search result that is a Dynamics item are expected to click the search result URI while logged in Dynamics. Users clicking such a link while logged out, for instance business partners mistakenly provided with the URI by one of your employees, cannot access the target item.

However, there might be some Dynamics content that you want to make available both internally and externally. For example, you could want to make your knowledge articles available publicly to allow your customers to resolve their issue themselves. With your Microsoft Dynamics 365 source providing Coveo for Microsoft Dynamics 365 with content that should be accessible both while logged in Dynamics and via your portal (i.e., while logged out from Dynamics), each item must therefore have two different URIs to display depending on the context: one to be used by Dynamics users, and one to be used by portal users. As a result, Dynamics users clicking the Dynamics search result URI will view the item within Dynamics and may be able to edit it, whereas portal users will view it in the portal.

  • John Smith is customer support agent at Speedbit, a fitness tracker company, and uses Dynamics to open support cases when customers need help with their Speedbit product. When helping a customer, John Smith enters keywords in the Insight panel search bar to find items relevant to the customer’s issue (see Insight Panel). Coveo for Microsoft Dynamics 365 then returns a list of items, which includes Dynamics entity records such as knowledge articles. When he clicks the Speedbit Device Skipping Steps knowledge article, he is redirected to the knowledge article page in Dynamics. The URL of this page starts with speedbit.crm.dynamics.com.

  • Barbara Allen bought a Speedbit fitness tracker recently. However, her device does not track the steps she takes accurately. She goes on the Speedbit customer portal and types My Speedbit skips some steps in the searchbox. Barbara Allen’s results include knowledge article Speedbit Device Skipping Steps, which she clicks. She is then redirected to the knowledge article page in the Speedbit Microsoft portal. The URL of this page starts with speedbit.microsoftcrmportals.com.

By default, your Microsoft Dynamics 365 sources has a clickableuri field for the internal URI (see Understanding Fields). To implement Coveo for Microsoft Dynamics 365 in your portal, you must create another field for the clickable URI of search results susceptible to be displayed in your portal search page.

  1. If not already done, in Coveo for Microsoft Dynamics 365, in the menu on the left-hand side of the page, click Administration Console to open the Coveo Cloud administration console.
  2. In the Coveo Cloud v2 administration console, in the menu on the left-hand side of the page, under Content, select Sources.
  3. In the Sources page, select your source in the list, and then, in the More menu, click Manage mappings.
  4. In the Edit the Mappings of a Source panel that appears, click Add, and then select Mapping.
  5. In the Apply a Mapping to All Items Types of a Source panel that appears:
    1. Under Field, click Add Field.
    2. In the Add a Field panel that appears:
      1. In the Field name box, enter a name for your portal clickable URI field.

        dyclickableuriportal

      2. In the Type drop-down menu, select String.
      3. Optionally, in the Description box, enter a description for the field.

        The clickable URI of a Dynamics item in a portal

      4. In the Advanced Settings section, select the Search operator, Displayable in results, and Free text search check boxes.
      5. Click Add Field.
    3. Back in the Apply a Mapping to All Items Types of a Source panel, under Apply to, select Specific item types, and then select an type of item to make public.

      You want to make knowledge articles public, so you select the knowledgearticle item type.

    4. Under Rules, add a rule allowing Coveo for Microsoft Dynamics 365 to build the portal URI for items of this type.

      By default, for knowledge articles, Portal uses the article public number. Your rule is the following:

      {portalUrl}/{path to your knowledge articles}/%[dyarticlepublicnumber]

      The path to knowledge articles is the path you chose when you made them available in your portal (see Get Dynamics 365 data on the portal).

      If your entity form uses the Dynamics entity ID in the URL, your rule becomes the following:

      {portalUrl}/{path to your knowledge articles}/%[dycoveoid]

    5. Click Apply Mapping.
  6. Repeat steps 4 and 5 for every item to make publicly available in your portal.
  7. Back in the Edit the Mappings of a Source panel, click Save and Rebuild Source.
  8. Once the source is done rebuilding, in the menu on the left-hand side of the page, click Content Browser to open this page and validate that the clickable URI of your Dynamics items is properly configured (see Content Browser).

Make sure the custom field meets the following requirements:

  1. Its value is a valid URI to the entity record that it represents.
  2. The user that clicks the hyperlink has the proper access to reach the content.

An empty or wrong value for this field will potentially make the item unreachable for the user.

Editing Search Result Templates

Once you have created a field for portal URIs and rebuilt your source to retrieve and index these URIs, you must edit the result templates of your portal search page so that the URI leading to Dynamics items is the appropriate one.

  1. If not already done, create a search page for your portal (see Adding and Managing Search Pages).
  2. In this search page, create or edit a result template susceptible to apply to Dynamics items, and then, in the Layout tab, select the Result Link component and click the Edit button (Edit button) (see Editing a Search page, Creating a JavaScript Search Result Template, and Selecting a Template to Modify).
  3. In the Result Link component options, under Field to use for href, enter the name of your portal clickable URI field, and then click Apply (see Adding a Portal URI Field).
  4. Repeat steps 2 and 3 for all other result templates susceptible to apply to Dynamics items.
  5. When done editing the desired result templates, at the top of the Interface Editor, click Save to save your changes.
  6. Publish your search page (see Publishing a Search Page).

What’s Next?

Proceed to the next step of the deployment process (see Adding a Coveo Search Page and Deploying Coveo for Microsoft Dynamics 365 in a Portal).