Category Archives: Customer Engagement

Simulate long operations in Dynamics 365 (CRM)

This article describes how to simulate a long operation in Dynamics 365 (CRM) using a simple custom plugin that introduces a delay using the Thread.Sleep function.

Background: recently we have been investigating an issue regarding some timeouts happening in a third party application which connects to our Dynamics 365 service. At the moment, it is difficult to tell if those timeouts are due to some slow connections to Dynamics or other reasons. In order to help us with this investigation, we are going to set the Timeout property of the OrganizationServiceProxy in the client application, which by default is 2 minutes.

Before applying this change, we also want to test it and simulate some long queries that would last longer than the client timeout limit set for the OrganizationServiceProxy. Here is where we have created this simple plugin “DelayOperation” that is going to introduce a delay for a certain number of seconds.

ramontebar_blog_Delay Operation Plugin_Sequence Diagram

For testing purpose, I have prepared a simple test that creates a Task record. See below the corresponding code:

ramontebar_blog_Create Task Test - Set OrganizationServiceProxy Timeout

Then we have registered our “DelayOperation” plugin in the create message of the Task entity, see below this plugin registration step:

ramontebar_blog_DelayOperationPlugin_Assembly Registration

ramontebar_blog_Delay Operation Plugin_Step Registration

Notice we pass the number of milliseconds to be used by the Thread.Sleep function as an unsafe plugin parameterIn our example, the client would wait for 10 seconds and the plugin would delay the operation for 12 seconds, causing the client to timeout.

Finally, our “DelayOperation” plugin code is:

ramontebar_blog_DelayOperationPlugin

You can download all this code from the following Github project:

https://github.com/rtebar/Dynamics-Utils

 I hope you find it useful!

Advertisements

Dynamics 365 v9.0 is already available

Some great news this week, the new Dynamics 365 (CRM) version 9.0 is already available for trial.

The build version I’ve got with my UK trial ([orgname].crm11.dynamics.com) is 9.0.0.11.03.

ramontebar_blog_Dynamics 365 v9.0

You can now enjoy some of the new features that I show below:

  • New design:

ramontebar_blog_Dyn365 v9.0 Main Dashboard

ramontebar_blog_Dyn365 v9.0 New Form design

  • New Unified Interface Apps

ramontebar_blog_Dyn365 v9.0 Apps Unified Interface

ramontebar_blog_Dyn365 v9.0 App with New Unified Interface

ramontebar_blog_Dyn365 v9.0 New Unified Interface

  • Flow Integration

ramontebar_blog_Dyn365 v9.0 Flow integration

  • Multi Select Option Set attributeramontebar_blog_Dyn365 v9.0 MultiSelect Option Set
  • New Solutions Components, including Virtual Entities:ramontebar_blog_Dyn365 v9.0 Solution Components

You can find more information about the new features in these Microsoft articles:

https://docs.microsoft.com/en-us/dynamics365/get-started/whats-new/customer-engagement/important-changes-coming

Changes for developers:

https://docs.microsoft.com/en-us/dynamics365/get-started/whats-new/customer-engagement/new-in-july-2017-update-for-developers

Enjoy your trial!