Internet Facing Deployment

As many of you know, one of the integral and unique parts of Dynamics CRM 4.0 is it’s ability to be Internet facing. This does not only mean that you have to choose between the ameneties of a normal AD logon and the grace of IFD, you can have both. So, even if you are just a small company with just a small business version of CRM 4.0 and not a larger corporation, there is no reason why you shouldn’t use Dynamics CRM 4.0 with the IFD technology.

So, how do you do it?

There are some good documents provided by Microsoft on how to do it(like this one: http://www.microsoft.com/downloads/thankyou.aspx?familyId=3861e56d-b5ed-4f7f-b2fd-5a53bc71dafc&displayLang=en) but there are some parts of it that are a bit tricky and depend on some of the infrastructure components you have, like DNS, and that might not be Microsoft, or even hosted. So I thought I’d describe a bit about how it works and give an example of how to do it.

First of all you have to do a normal installation of CRM 4.0. You can install on port 5555, 80 or any other TCP port. It doesn’t matter for IFD deployment, however, port 80 or 443 have to be made available from the Internet so the physical placement of the CRM server is critical. You can use normal redirect techniques or reverse proxy lookup (as in ISA-server). The important fact is that the server must be placed so that it can be reached from the outside.

The next thing you have to set up is an external name that you can use when adressing the server from Internet, hence it has to be a real name and not just an internal name. If you have registered a domainname you could set a hostname to point to the organizations you want to access.

I used dyndns.com and registered a name like “mydomain” and my CRM organization was mycrm, when using IFD that would make the address for this org:

http://mycrm.mydomain.dyndns.com

Make sure that everything bellow mydomain.dyndns.com also gets redirected to you CRM servers external URL (port 80 or 443 depending on if you are using SSL or not)

The next step is to run the IFD Tool as referenced in the Microsoft Document. It can be downloaded from here.

Use it to set up CRM by setting the right stuff in the web.config and setting some keys in the registry. It is a lot easier than doing it yourself. You have to set it up to the external name you have chosen.

Now the final step is to add a host header in the IIS website for CRM for *.mydomain.dyndns.com or explicitly for mycrm.mydomain.dyndns.com for port 80 or 443 depending on your setup.

Now you should be able to browse to mycompany.mydomain.dyndns.com and get to the logon screen.

To get reports working you have to install the report connector software found on the CRM CD/DVD.

There are of course lot of variations to this, using reverse proxy of ISA Server and all the options of setting up certificates for SSL but I’ll leave that out of this posting to keep it simple.

Menno has recently published a posting on this as well (http://www.tekoppele.com/Blog/post/2009/05/30/How-to-configure-an-Internet-Facing-Deployment-for-Microsoft-Dynamics-CRM-40.aspx, and there are several other blogs and MS KB articles concerning this. If you have problems, try taking it a step at a time and analyse and design the setup first so that you have got it figgured before you start configuring!

Good luck!

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Enhancing performance in virtual machines

I follow the blog Microsoft Dynamics CRM UK Blog which is very good and they had an interesting posting today concerning performance issues in virtual PC 2007 on laptops. As most consultants, I use one (a lenovo T61p). You can read more about it here: http://blogs.msdn.com/ukcrm/archive/2009/05/07/virtual-pc-2007-performance-tweaks.aspx

When I tried to apply the change to the file they mentioned (%appdata%MicrosoftVirtual PCoptions.xml) I had a problem since I didn’t have the parent tag in my file. I checked around a bit and found that it could just be added to the main structure. So, after modifications, my file looked like this:

—-
</virtual_network>
<virtual_machines>
<enable_idle_thread type=”boolean”>true</enable_idle_thread>
</virtual_machines>
<window>

I would recommend adding it, if you most of the time have the computer connected to the power outlet, since it will probably increase the performance of your virtual machines!

Gustaf Westerlund
Microsoft Dynamics CRM 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

Errors when programmatically attaching events in forms

Today I had a very weird error. I had two datetime fields on a form, one on the first tab and one one the second. Let’s call them date1 and date2 to make it easier.

I attached an event in the onload by using

crmForm.all.date1.attachEvent(“onchange”, myFunc1);

and for the date2 field:

crmForm.all.date2.attachEvent(“onchange”, myFunc2);

The weird part was that if I changed date1 first and then date2, myFunc2 didn’t fire. But if I first changed date2 and then date1, both fired as they should.

So I tried just adding an alert instead using the normal onchange method via the form editor in CRM and that triggered every time, just as it should, so something is different.

The simple solution seemed to be to move date2 from the second tab to the first. That got everything working just as it should.

I havn’t tried it but I think that one could also write a method that confirms all the event attachments and then calling this at the end of every onchange triggering function and perhaps some extra time when the tabs are changed to make sure the events are bound correctly.

I have checked the documentation in CRM for if this kind of runtime event attachment might not be supported but my interpretation of the text is that is should be all right according to it. The closest paragraph in the unsupported customization section is the following:

“The use of custom HttpModules to inject HTML/DHTML into the Microsoft Dynamics CRM Forms. “

As I wrote, my interpretation is that attaching events (not even overwriting the onchange), should be ok according to this since we arn’t injecting anything, just adding an event listener. Hence I feel that this must be interpreted as a bugg in CRM.

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Unicode conversion

When writing javascripts with alerts or similar when not working with english, special characters like the swedish åäö might not be shown correctly. I found this helpful page where you can enter the string you want to convert and then copy paste the result. Simple and nice.

http://rishida.net/scripts/uniview/conversion.php

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com