Configure Similar Record Suggestion using Cognitive Services Text Analytics (Preview) in Dynamics 365 (online)

As a first step, we need to enable text analytics and connect it to CRM.

Follow the below post for enabling text analytics, connecting CRM online to Text Analytics service.

https://nishantrana.me/2017/03/24/configure-case-topic-analysis-using-cognitive-services-text-analytics-preview-in-dynamics-365-online/

As a next step, we need to configure Similar Records Suggestions, for that go to

Settings – Data Management – Similar Records Suggestions settings

Click on New to create a new similarity rule record

Below we have created rule with Case as source entity and specified Yes for “Use Text Analytics for Target Match”

After we have created the similarity rule, we need to define the fields based on which matching will be done and suggestions will be made.

Here we have specified Criteria as Text Match, which would match the Text for the field Case Title of the Case Entity.

Save the above record and click on Activate to run the similarity rule.

Open any of the existing case, in our below scenario we have opened the case with title “Delay in Shipment” and click on +

This opens up the dialog that shows similar cases (with title having Delay word in it) using Text Analytics Service configured.

What happens if we deactivate the Similarity Rule?

We get the below error –

Checking the metric in the Text Analytics API.

Get all the details here

https://technet.microsoft.com/en-us/library/mt703318.aspx

Hope it helps..

Requests to this API should contain at least 100 documents, where each document is not null or empty error while configuring Topic Analysis using Text Analytics in Dynamics 365

Hi,

Recently while trying to configure Topic Analysis in Dynamics 365

https://nishantrana.me/2017/03/24/configure-case-topic-analysis-using-cognitive-services-text-analytics-preview-in-dynamics-365-online/

we got the below error for the failed record.

Error Message:{“code”:”BadRequest”,”message”:”Invalid request”,”innerError”:{“code”:”InvalidRequestContent”,”message”:”Requests to this API should contain at least 100 documents, where each document is not null or empty”,”minimumNumberOfDocuments”:100}}

This was because we had very few case records in our CRM organization < 30. We created few more records to increase the count to be more then 100 and re run the build. This time it got succeeded.

Hope it helps..

Configure Case Topic Analysis using Cognitive Services Text Analytics (Preview) in Dynamics 365 (online)

Text Analytics Preview feature is currently available for instances in US region. Topic analysis can be used to automatically identify topics that occurs in cases.

To enable the preview, go to System Settings – Preview tab and select Yes for Text Analytics Preview.

Click OK to confirm.

Next go to Administration and click on Azure Machine Learning Text Analytics Service configuration to configure the service.

Here we would need the Azure service URL and the Azure Account Key to configure it.

To do so, go to Azure Portal

https://portal.azure.com

Search for Cognitive Service Accounts

Click on Add and Specify required information.

Select Text Analytics API as API Type.

Click on create to create the service account.

Copy the Endpoint of the created Cognitive service account which will be used as Azure Service URL in CRM.

Similarly select Keys, and copy one of the Key which will be used as Azure Service Key in CRM.

Specify the values in the Text Analytics Connection record.

Click on Test Connection to test the connection.

After successful test, click on Activate to activate the connection.

Next let us create a Topic Model which will be used to identify topics occurring in the cases.

Go to Service Management – Automatic Case Topics Analysis Settings

Create a new Topic model record

Create a related Topic Model Configuration record.

It auto populates the Topic Determination Fields which we can edit\add.

Specify the configuration record created in the Configuration lookup of Topic model record.

Click on Test to the configuration.

Build Execution History tab shows the status of the test run.

The build can be scheduled.

Once we have tested the configuration we can then activate the model.

Once Activated, we can them manually trigger the build using Build button

We can check the status of the build in the build execution history tab. Below record shows the build to be succeeded, duration it took i.e. 6 minutes, number of records it synchronized i.e. 159 and topics identified as 9.

To see it in action, go to Active Cases view and select Case Topics chart which lists the topics.

Hope it helps..

Dynamics CRM, Web Job and Azure scheduler

Let us built upon our previous example where we created a Hello World console application, hosted it as web job in Azure App Service and then scheduled it using Azure Scheduler.

Scheduling a Web Job (console application) using Azure Scheduler

Here we will basically update the code in Console Application to use CRM’s assemblies.

Just for simplicity we’d create a lead record in our app and then schedule it to run every 2 minute for total of 5 occurrences.

In real world, obviously, we’d have different scenarios like checking for the status of records and send mail every 24 hour or so, or delete records periodically etc.

We have added the required CRM assemblies

The code to create lead record.

Publishing the updated code.

Running it.

Checking the logs.

Inside CRM it creates the lead record

Now let us re visit our Azure Job Scheduler, update the schedule to run 5 times with interval of 2 minutes.

Click on Run now to run the Job.

We can check the history of the Scheduler Job once it completes –

Logs of the Web Job –

5 Records created in CRM with interval of 2 minutes.

Hope it helps..

Configuring Data Export Service in Microsoft Dynamics 365

Data Export Service is an add-on that allows replicating CRM Online Data to Azure SQL Database.

The below video by expert Scott Durow is the best resource to learn about it

https://www.youtube.com/watch?v=txms2Yvn6Vc

Below are the steps we need to follow to configure it.

  • Go to Settings – Dynamics Marketplace

  • Search for Dynamics 365 Export Service

  • Click on GET IT NOW

  • Click on Agree

  • This will install the Data Export Service solution

  • Back in CRM – Go to Settings – Data Export. (Pop up window will open up a page for Data Export Authentication, so we need to enable pop up)

  • Click on New to create a new Data Export File.

Basically, here we need the Key Vault URL here which stores the database connection string securely.

Clicking on the information icon opens up the dialog box with the below PowerShell script, which needs value for variables like subscription id, key vault name, secret name, tenant id etc.

i.e.

So as a first step here we need to configure Azure Active Directory (if Office 365 and Azure Tenant are separate)

https://docs.microsoft.com/en-us/azure/billing/billing-add-office-365-tenant-to-azure-subscription

  • Next step is to create Azure SQL database. Search for SQL databases in All Resources and click on Add

  • Specify the required information and click Create.

Next we need to create a User that will be used to configure Data Export Service and has appropriate rights in the database

Here the user has been assigned db owner role

 

For the minimum rights required check the below article

https://technet.microsoft.com/en-us/library/mt744592.aspx

Now let us replace the below placeholders one by one

  • Subscription ID
  • Key Vault Name – NishantDemoKeyVault
  • Secret Name – DataExport
  • Resource Group – DemoRG
  • Location – East US
  • Connection String

  • Organization ID List

KeyVault record created in Azure à

  • Going back to our Export Profile wizard, we need to paste the Key Vault URL

  • Click on Validate

  • Select the entity or entities for which profile needs to be created

  • Select any relationships 

  • Next click on Create and Activate

This creates the profile record in CRM

  • Once Initial Sync Status shows as completed we can see the tables created in the Azure Database.

The records synchronized –

Let us delete the below selected lead records –

Delete Log table will hold the information of the deleted lead records

To create export profile for a custom entity, (say for e.g. entity named Test in our case)

We need to enable Change Tracking in it.

Get all the details here

http://develop1.net/public/post/Dynamic365-Data-Export-Service.aspx

https://technet.microsoft.com/library/a70feedc-12b9-4a2d-baf0-f489cdcc177d

Hope this helps..

Partner Field Service Portal in Dynamics 365.

Dynamics 365 comes with Partner Field Service portal which helps Partners manage work order, service request, assets, invoices, opportunities etc. from within the portal.

Go to Administrator Center, select Portal and click on Manage.

Select Manage Dynamics 365 Instance

Click on Update Dynamics 365 Instance

Select Partner as Audience and Partner Field Service as the portal to be deployed

Once installed this is how Partner Portal looks like

Below are the different menu options that comes OOB.

Partner Program

Opportunities

Customers

Field Service

Below are the Entity Forms associated to the Partner Portal Web site created in CRM.

Below are the Entity Lists associated to the Partner Portal Web site created in CRM.

Around 121 Entity Permission records are added by the Partner Portal

Web Roles specific to Partner Portal.

Below are some of the permission for the Partner Admin web role.

Once the portal is setup next step would be to Become a Partner. Click on Begin Here.

Update the profile and click on submit.

Within CRM, the admin user needs to run the Approve Partner Application workflow on the corresponding portal contact user record.

After workflow succeeds we can assign appropriate web roles to the portal contact user.

The portal user can create customer contacts record

The portal user can raise Service Requests from within the portal.

Can manage Work Orders.

Can manage Opportunities.

The portal has the Dashboard that shows the details around the opportunity and the cases.

Hope it helps..