Email router on Windows Server 2008 R2

A customer of mine is running CRM 4 in IFD mode on a Windows Server 2008 R2 and I thought it might be a good idea to activate the Email router and talk to them about sending mail using that instead of the internal email handler to reduce the need for them to be online with their Outlooks for things to work.

Well, as usually I set up the email router on the CRM-server but was baffled when I couldn’t connect to it. I just got this weird error of 401 Unauthorized error. I tried everthing, changing the users, adding the user to the privusergroup, changing the ADWebApplicationRootDomain. After some googling I found the solution on this excellent blog.
http://crmwizard.blogspot.com/2010/02/server-2008-and-email-router-with-ifd.html

It turned out that the server was using IPv6 to access itself and the onpremise exceptions set up in the IFD settings were only based on IPv4 hence it tried to access it in the IFD mode. I just switched IPv6 off in the network adpater and everything worked as it should.

If you speak swedish, there are some interesting discussions on http://www.crmforum.se/, the only Swedish CRM-forum dedicated to Dynamics CRM. So head over there and digg in!

Gustaf Westerlund
CEO, Chief Architect and co-Founder at CRM-konsulterna AB

www.crmkonsulterna.se

Webservice loading strange workflows

Had an interesting problem today. I want to trigger workflows from an aspx-page by finding the right one by name and for some reason, I got an exception that the workflow had to be flagged to allow manual activation or to be run as a subworkflow. This was very strange since I several times checked the workflow and it was not only published, but both the flags for manual activation and run as sub workflow were checked.

So, I applied my principle of first trying to find where the error was instead of finding what it was.

By tracing and checking some, I found that the webservice actually returned 4 workflows with the exact name I was looking for. I tried to load some of them in the GUI by changing the URL and they did load but they were strange some how since I could not change them. 2 were drafts, 2 were published, 2 were marked as runondemand and 2 were not. The last one proved to be the right one (both published and runondemand).

So, I had to change the code for fetching the GUID for a workflow with a specific name, so that it also checked that the workflow was both published and was allowed to be run on demand. So, if you run into similar problems, you know what to do.

Gustaf Westerlund
Microsoft Dynamics CRM Chief Architect
Logica
www.logica.com

Marking an appointment as finnished from Outlook

One of the best features of Dynamics CRM is the integration to Microsoft Outlook. In comparisson to competing CRM systems, this is really one of the strongest unique selling points of Dynamics CRM.

However, even though it is really good, there are some parts of it that could use some touchups and until that happens, some workarounds would be good.

One of these issues, is that appointments can easily be created from Outlook and mapped to some object in CRM. This is easy and very few click. Nice. But, when this appointment is completed, it is a bit more complex and a lot more clicky. First you have to open the appointment in Outlook, then open the appointment in the CRM form. From there, you can press the “Save as completed” button, which is a bit tedious and many users find this a bit strange and I am having a hard time explaining why you have to do it this way, it isn’t very obvious or logical. The best solution would be that the CRM addin had a button which could mark appointments and other activities as completed. But that just isn’t there yet.

So, is there a workaround, yes, of course there is. It isn’t perfect, but it will work.

Define some text, like for instance “Completed” and then tell the users to put Completed as the last text in the description field or in the subject field.

Then create a workflow in CRM that triggers for updates on the field where you expect the text. Then let the workflow check if the end of the content of that field is “Completed” and if so, set the appointment as completed.

The same functionality could of course be implemented in a plugin instead, but that requires a bit more programmatic skills.

The functionality of adding a button to Outlook can of course also be developed with Visual Studio Tools for Office (VSTO), and that could of course be used to automatically update the appointment as completed.

So, that might help you out a but I really hope that the CRM Client for version 5 will deliver this functionality since it isn’t very hard to do when the rest is there.

Gustaf Westerlund
Microsoft Dynamics CRM Chief Architect

Logica
www.logica.com

Back to old times

Today I got involved in a project I havn’t been working in for about 2 years, a CRM 3 project that now was upgraded and there were some issues with callouts not executing properly on the production system but there were no problems on the test system. So, there probably wasn’t a code error.

After activating the crm tracing (alway a good thing to do when CRM is missbehavn’) it was quite clear that it couldn’t find the dll Microsoft.Crm.Platform.Callout.dll which of course is required by CRM 4 if you want to execute workflows since this assembly contains the classes that are inherited from in the callouts. It is a bit strange that this dll isn’t included in CRM 4 since callout are supposed to be seemlessly upgradable to CRM 4 and this is the one little stich that is missing. So, just had to dig it up and deploy it to the GAC and the callouts started working as they should.

During this I also thought there might be errors in with the assembly being unsigned and after some looking around, I found that in Visual Studio 2003 it isn’t found in the project settings so you have to fix it manually in the assemblyinfo.dll. However, this doesn’t seem necessary event though it doesn’t hurt.

So, what did I learn?
1. When in doubt, switch on CRM tracing.
2. Make sure you have a good store of all dll:s that CRM uses so that you quickly can find them. How many of you have the Microsoft.Crm.Platform.dll in the CRM 3 hosted version? It is quite rare and can be found on the installation disks but not anywhere on MSDN. If you need it, drop a comment. I approve all comments due to all the #¤#¤¤# comment spammers so you can enter your email and ask me not to publish the comment, and it wont be subject to email harvesters, if you want me to email you the file.
3. Don’t take promises of seemless upgradablity too serious. MSFT have done a great job with CRM, you don’t even have to recompile (and consider that CRM 3 uses .NET 1.1 and CRM 4 .NET 2.0 from an IIS perspective) so always do a test upgrade a couple of times before you do it live and make sure to write down all the steps you are taking. Let’s hope the upgrade from CRM 4 to CRM 5 will be truly seemless!

Gustaf Westerlund
Microsoft Dynamics CRM Chief Architect

Logica
www.logica.com

Importing large customization files to vanilla system

Sometimes you will need to import large customization files from one system to a vanilla system (no customizations). This file will often include workflows as well as new entities and attributes.

Since the workflows are dependant on the entities of the CRM system, a workflow cannot be imported if the entities it depends on do not exist.

This is usually not a problem in English based systems since Workflow starts with the letter “W” and hence is quite far down the list. In Swedish it is named “Arbetsflöde” and hence will be placed at the top. So, when importing the customization file, if importing everything, the system might give you an error if any workflow is dependant on an entitiy with a displayname after “A”.

The solution is simple, just import everything but workflows first and then import workflows.

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com