Blog Archives

Resco Mobile Certificate Pinning validation

This article describes a new security feature now available in the Resco Mobile solution that allows certificates validation. This is an important consideration when you are dealing with mobile devices.

During the last months, we have been working with the Resco.net solution integrated with Dynamics 365 and it has been a great experience. It is definitely a very competitive alternative if you are considering a mobile solution for your business and CRM implementation.

ramontebar_blog_resco.net_web

This new Certificate Pinning validation feature has been introduced in the version 10.2.1. 

Basically it allows the mobile client to confirm if the service that is connecting to (e.g. Dynamics 365) is the expected one.

Normally, once you configure the Resco App with the corresponding Dynamics 365 URL, you would expect that everything would be ok and the connection would be safe based on the TLS protocol:

ramontebar_blog_TLS Certificate

However, in a hostile environment where the network may not be reliable, a malicious party could take advantage of it and intercept this connection, providing a fraudulent certificate:

ramontebar_blog_Malicious TLS Certificate

To avoid this risk, Resco has implemented a certificate pinning validation based on their current solution:

ramontebar_blog_Resco Certificate Pinning solution

Within Woodford, an administrator will now be able to configure the expected certificate(s) thumbprints:

ramontebar_blog_Resco Woodford Certificate settings

The Certificate Thumbprint can be found easily using, for example, Internet Explorer:

ramontebar_blog_Dynamics 365 Certificate root

ramontebar_blog_Dynamics 365 Certificate Thumbprint

In this example, the Mobile Resco App would have downloaded the corresponding Woodford Project with the Thumbprint “62 7C 0A 58 A2 64 76 77 1D 55 74 10 35 56 F8 79 54 33 F6 05”. When the app connects to the service, it compares that value with the one in the actual certificate. If they were the same, it would carry on; otherwise, the user would get the following error:

ramontebar_blog_Resco Mobile App Certificate error

You can find more details about the Certificate Pinning technique in the Open Web Application Security Project (OWASP)

**Images Credits: Icons made by Freepik and Smashicons from https://www.flaticon.com

Advertisements

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!

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!

Presenting at CRMUG Summit EMEA. Amsterdam 2017

This year I’ll be presenting at the CRMUG Summit EMEA 2017 celebrated in Amsterdam. The idea started last year when I was speaking with my Microsoft AX MVP colleague Antonio @_Gilabert_ at the MVP Summit.

CRMUG_EMEA_Summit_Amsterdam2017_Home

With Dynamics 365, CRM and AX are closer than ever, so we thought that it would be great to have a presentation together and share our experience and view with the community.

We would like to do a functional and practical session where we will show how both platforms can be integrated, in the new Dynamics 365 world, to deliver a real business scenario. Our challenge is to use the new Microsoft Flow and Common Data Service for the integration. At the moment, they are still very new and many capabilities are very limited.

Although we are still working in the demo, we are also preparing a PowerApp to improve the user experience and present how they can be useful alongside Dynamics 365 for Sales and Operations.

I would also like to say thank you to Hugo de Jesús, who is helping us a lot to prepare the presentation.

You can find more information about the schedule in this link.

We hope you enjoy the event, and of course, our session! 🙂

CRMUG_EMEA_Summit_Amsterdam2017_CRM and AX rock together

 

 

Dynamics 365 (CRM) Scheduled Workflows using Microsoft Flow

Creating scheduled workflows has always been a challenge in Dynamics CRM 365. The community and ISVs have offered several original options, but there is not yet an official out-of-the-box option. This article brings another alternative to the table using Microsoft Flows.

A scheduled workflow is the one that runs at a certain arranged time and it may recur to run again after a period of time. If you want to understand more about this challenge and how our CRM community has resolved it so far, have a look at the following articles:

Microsoft Flow offers the option to create Recurrence jobs. This can be used to schedule and trigger actions in Dynamics 365, like retrieve, create or update records (see available actions). So, using this functionality you already have a good alternative to create your own scheduled workflows without development effort. You can see some examples in the following article as well as in these Dynamics 365 Flow templates.

The other alternative would be a mix solution where a recurrence Microsoft flow creates a custom Dynamics 365 “Scheduled Job” record and this triggers the corresponding Dynamics 365 workflow. The “Scheduled Job” entity would have attributes like “Process Name”, “Run as” (e.g. system user name), “Query scope” (e.g. FetchXML or view name), …, to specify what and how to run the workflow. This option would require additional development, either a plugin or a custom workflow activity to call on demand the given process, but it would also allow you to reuse the logic and capabilities you already have within Dynamics 365.

Hope you find this article useful. Looking forward to hearing your feedback.

Thanks

Too many active business process flows

Have you seen that message before on your Microsoft Dynamics CRM organisation?

Too Many Active Business Process Flows Error

You may have if you have tried to activate more than 10 business processes at the same time for the same entity.

List Of BPF On The Case Entity

This is a limitation by design which is well-known and described on the Microsoft technical documentation, have a look at the following article.

This limitation can be changed using the organisation property Organization.MaximumActiveBusinessProcessFlowsAllowedPerEntity. The easiest way to to change this attribute is using the following tool: Dynamics CRM Organization Settings Editor (OrgDBOrgSettings)

CRM Org Settings Editor

And now, you may be thinking: “why on earth would you do that??”

If your CRM deployment is heavily used, some core entities (e.g. Case, Opportunity) may be used intensively on different processes across an organisation.

Note: the current CRM version I’m using is: (8.1.0.369) (DB 8.1.0.369)

[Dynamics CRM] Find processes by content

Using any version of Dynamics CRM, have you ever tried to find all processes that contain

  •  A certain Step in some Business Process Flow
  • A Custom Workflow Activity that you have developed and you try to reuse in several Workflows
  • A Dialog that contains some particular question
  • An Action with an specific parameter

If so, probably you noticed that Advanced Find (an out-of-the-box CRM tool to create custom queries) is not enough.

Let’s just understand the anatomy of the processes. CRM uses internally Windows Workflow Foundation as its workflow engine, so that CRM processes are defined using XAML. So, when you create a process using the CRM UI designer, the platform translates it to XAML.

So, then, we are looking for those processes which XAML contains some text. Looking at the metadata of the Process entity, we can see there is an attribute called XAML:

DXTools Metadata Browser - Process XAMLNote: You can find this Metadata Browser in CodePlex, see http://dynamicsxrmtools.codeplex.com/. You can also use the CRM SDK Metadata Browser

Now the question: how do we interrogate this XAML attribute? Solution: CRM OData query

CRM exposes an OData service which can be easily consumed by external applications or even using the browser. See more information in CRM SDK. Because this service allows to access more attributes than the Advanced Find tool, we can use the next query to find the processes whose XAML contains a certain string:

https://[OrganisationName].crm[x].dynamics.com/xrmservices/2011/OrganizationData.svc/WorkflowSet?$filter=substringof(‘[String]‘,Xaml) and Type/Value eq 1

The parts marked with brackets should be replaced with your corresponding context. The last condition is just filtering the Type of process, returning only those which are the actual Definition (Value: 1).

You can also build easily this query using the tool OData Query Designer in CodePlex, see http://dynamicsxrmtools.codeplex.com/.

Let’s try it now! Out of the box there is a Business Process Flow called “Lead to Opportunity Sales Process”, which contain an step with name “Existing Contact?”:

RTBlog - XAML Process - LeadToOpportunityFlow

RTBlog - XAML Process - LeadToOpportunityFlowDefinition

Let’s say we want to find any process that contains that step “Existing Contact”, so we will use the next query:

https://%5BOrganisationName%5D.crm%5Bx%5D.dynamics.com/xrmservices/2011/OrganizationData.svc/WorkflowSet?$filter=substringof(‘Existing Contact‘,Xaml) and Type/Value eq 1

Just putting that query in IE, we will see the next results:RTBlog - XAML Process - ODataQueryResultsSample1

Another example. Let’s say you are using N52 Formula Manager and you want to find all processes that are using a particular Formula Genie. In our example, this formula is going to generate a Hashcode for a given contact based on its fullname. This hashcode can be used for de-duplication:

RTBlog - XAML Process - N52FormulaGenie

Now, I want to find all the processes that are using this formula at least in one of their steps. So I will use the next OData query:

https://%5BOrganisationName%5D.crm%5Bx%5D.dynamics.com/xrmservices/2011/OrganizationData.svc/WorkflowSet?$filter=substringof(‘uzX,Xaml) and Type/Value eq 1

Where “uzX” is the formula short code.

Putting that query on IE, I will get the next results:

RTBlog - XAML Process - ODataQueryResultsSample2

New Customer” is a custom process that I created to use that formula and generate a hashcode every time a new contact is created or its full name gets updated:

RTBlog - XAML Process - NewCustomerWorkflow

See below a contact sample with a hashcode (below full name attribute), which has been generated by the above process:

RTBlog - XAML Process - ContactHashcodeSample

 

 

Microsoft publishes CRM SDK in NuGet (Visual Studio)

CRM SDK is now also available from the Visual Studio extension NuGet. This extension is a provider of third party packages where anyone can participate and publish their own ones. This makes very easy to add third party assembly references.

  • Install NuGet in Visual Studio from “Tools => Extensions and Updates”

  • Once NuGet is installed, create a Visual Studio Project (a library for example) and make right click on the Visual Studio project where the CRM SDK assemblies will be used. Select “Manage NuGet Packages…”

  • Choose the Online option on the left menu and search for “crmsdk“. A list with all the CRM SDK assemblies published by Microsoft will be presented. Choose the corresponding assembly based on its version.

In this case, I have installed the CRM 2013 assemblies:

  • Notice the new package and reference configuration linked to the project:
    • packages.config” file in the project where the NuGet packages have been installed

    • New folder with the assemblies in the root solution folder. You can find the assembly file within the package folder. In this case, the new CRM 2013 SDK package contains two assemblies, see below:

    • New library reference have been added automatically to the chosen project: