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.
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! 🙂
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.
Have you seen that message before on your Microsoft Dynamics CRM organisation?
You may have if you have tried to activate more than 10 business processes at the same time for the same 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)
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: (18.104.22.1689) (DB 22.214.171.1249)
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:
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?”:
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:
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:
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:
Where “uzX” is the formula short code.
Putting that query on IE, I will get the next results:
“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:
See below a contact sample with a hashcode (below full name attribute), which has been generated by the above process:
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:
[CRM 2011] Intermittent RetrieveMultiple error: Index was out of range. Must be non-negative and less than the size of the collection
Few weeks ago, I faced an interesting intermittent issue using the CRM Service, specifically with the RetrieveMultiple message. Basically, there was a WCF service wrapping the CRM Service and eventually we were getting the same issue you can find in this MSDN CRM forum post
After some deep investigation, it turned up to be a thread safe issue related to the way IServiceConfiguration and IServiceManagement are shared internally in the CRM libraries. IServiceConfiguration is not safe thread. Another important point to be considered was the early-bound types, which are not guarantee to be thread safe. (See http://technet.microsoft.com/en-us/library/gg326004.aspx).
Finally, a simple solution for this issue was to change the connection configuration:
CrmConnection crmConnection = new CrmConnection("myCRMConnection");
crmConnection.ServiceConfigurationInstanceMode = ServiceConfigurationInstanceMode.PerInstance;
using (CRMContext serviceContext = new CRMContext(crmConnection))
ServiceConfigurationInstanceMode.PerInstance is the key
Related to this topic, I recommend reading the new section Best Practices for Developing with Microsoft Dynamics CRM 2011, which is part of SDK 5.0.12 and newer ones.
Updating from Visual Studio an existing SSRS CRM report (e.g. Activities) may require an external reference to the assembly Microsoft.Crm.Reporting.RdlHelper.dll. This assembly contains several helper functions which can be used from your report.
This assembly can be found in the SSRS report server, normally in the next folder:
C:\Program Files\Microsoft SQL Server\MSRS10.CRMRS\Reporting Services\ReportServer\bin
An easy way to make this reference works is your Visual Studio is to deploy the same assembly into the GAC of your desktop
In my case, I updated the Activities (parent) and Activities Detail (child) reports to include Accounts as part of the regarding. Out of the box, this report only provides the activities linked to Incidents and Opportunities.
Basically, I followed the next steps:
1) Download SSRS report from CRM. Edit Activities report => Actions => Download report and rename it. Repeat the same for Activities Detail report
2) Open Activities report from Visual Studio
3) Deploy RdlHelper.dll in the GAC of my desktop
4) Edit DSActivity dataset query to include accounts (both reports, parent and child)
5) Include new parameter CRM_FilteredAccount (both reports, parent and child)
6) In your new renamed Activities report, update series action to go to new child report. From Design View, right click on the series => Series Properties =>Action => Go to report and selecte the new child report, the one renamed from Activities Detail. Just in the same form, add a the new parameter CRM_FilteredAccount – [@CRM_FilteredAccount]
7) Upload your new reports to CRM.
8) Set up the parent report for the new child report Activities Detail.
I hope it helps.
Basically we have two options to change our hombe page in CRM 2011:
- Per User: Using UI, any user can change his/her own home page. See the next post
- All User: This is not as user friendly because we have to call the webservices (Online or On-Premise) or run a SQL script (On-Premise)
SQL Scritp: Run the next script:
set HomepageArea =‘A’, HomepageSubarea =‘A_1’
Getting a MSCRMTracing error in your Event Log? Probably you have read the next entries. Once you understand them, apply the PowerShell script showed below.
$setting = Get-CrmSetting TraceSettings
$setting.Directory = ‘Drive:\Program Files\Microsoft Dynamics CRM\Trace’
Last week we got a couple of new releases for Microsoft Dynamics CRM 2011: Update Rollup 10 and SDK 5.0.12
Update Rollup 10:
- Windows 8 / Internet Explorer 10 / Office 2013 Preview compatibility
- Many performance and stability-related fixes, including fixes to the CRM Client for Microsoft Outlook
- Contains all hotfixes / updates originally scheduled for release via Update Rollup 9
- Quick Find performance optimizations and EnableRetrieveMultipleOptimization SQL query performance optimizations:
- The Update Rollup 10 Microsoft Download Center page (on August 16th, 2012)
- The Microsoft Update Catalog (on Sept. 11th, 2012)
- The Microsoft Update detection / installation process (on Sept. 11th, 2012)
Some important notes:
- Update Rollup 9 will not be released publically because of a delay in the Q2 Service Update
- Update Rollup 10 is cumulative
- Update Rollup 10 Build number: 5.0.9690.2730
- Prerequisite: Update Rollup 6 installed (build 5.0.9690.1992)
You can find a full summary in the next post from Dynamics CRM in the Field blog:
Some of the features (all details in the Release History section):
- Updated assemblies for Microsoft Dynamics CRM 2011 Update Rollup 10.
- A new Form Scripting Quick Reference that provides simple explanations and examples of the Xrm.Page object methods on a single page.
- Updated the information on Best Practices about service channel allocation performance
- A new topic called Choose your Development Style for Managed Code that describes the choices of tools and classes you can use when you write managed code and provides information to help you decide what is best for your needs.
- A new topic called Create Accessible Web Resources that provides an introduction to creating web resources that offer equivalent functionality for all users so that people with disabilities will be able to use your web resources.
- Added information about quick find query optimizations and a new property “IsQuickFindFilter” in the FilterExpression class to provide consistency between Query Expression and Fetch XML queries
- Improved authentication helper code and a new sample that demonstrates how to connect to the web services without using helper code.
- Added information about enabling IFRAME communication across domains and use window.postMessage
- Code changes to work in browsers to be supported in a later release, and information to guide you in making those changes.
- Added information about how to manage solution files in source code control using the new SolutionPackager tool
- Using the metadata diagram tool for creating entity model diagrams
- How to authenticate and do basic operations from Java
Some important notes:
- SDK Version 5.0.11 has been skipped