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

Workflow warning

Today I was troubleshooting a CRM server which had the CRMAsycnService and w3wp service totally hogging the machine. It was quite obvious that it was CRM that was the cause for this and since CRMAsyncService was involved, probably workflows or perhaps the deletionservice.

After a bit of looking around I found a workflow that was set to trigger on attribute change on an entity and then later in that same entity, changed some attributes. This caused an infinite loop which was the cause for the hogging. By first unpublishing the workflow and then removing all started systemjobs, I got the machine back up to speed.

My conclusion from this is that even though the workflow GUI seems easy it is deceitfully powerfull and you quite easily create workflows that hogg the server (the server hosting the async-service anyway). This should be taken into consideration when putting this tool into the hands of non-programmers since the risk for the entire system stability is large. This can be either application consultants or power users at the customer.

There is also no standard way of locking some of the triggers on workflows so that you can eliminate this risk. I you know of any, please leave a comment!

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Process implementation strategy

When implementing a business process in Dynamics CRM there are several different implementation paths to choose from. There are advantages and disadvantages to the different techniques but there are some goals that I feel the implementations should meet, mainly:

1. Fully supported customizations only

2. Flexible and non-static.

3. Power user modifiable

4. Movable from environment to environment (dev-test-production)

I will discuss the different aspects bellow and why I feel they are important.

Fully supported customizations only

This is almost so self-evident that it doesn’t even need mentioning but I have seen several CRM implementations that not only nudge this paradigm in the corner, but bite big large chunks out of it. For me, the number one reason why this is so important is that all customers will sooner or later want a hotfix or upgrade to a later version and when Microsoft, in their greatest foresight and benevolence definied the concept of supported customizations, they made this possible without costly maintanance agreements or hostile customer relationships. So, not following it should be punishable by death or something close to it.

I would presume that you CRM implementations are meant to last for your customers and that you want a long a fruitfull relationship with your customer, why you just cannot underestimate this point. If you have to make unsupported customizations, make sure they are as light weight as possible, document them thouroghly and how to validate them when installing a hotfix or upgrade.

A business process must hence be made as supported as possible.

Flexible and non-static

The solution has to be flexible and non-static. We, and our customers live in an ever changing world and to cope with this, business processes have to change as the world around a company changes. Just imagine the changes the telecom industry has gone through the latest 20 years. To fully accomodate this the customer implementations have to be flexible and changable. Microsoft Dynamics CRM is one of the most versatile and flexible systems available, especially now that it incorporates windows workflow foundation. Implementing a business process in code entirly, locks the processes down, and builds a dependance on the CRM delivering partner, something every customer-value focused consultant must despise. I do not need to force my customers to use my services when I can get them to choose me because of the value I deliver to them every hour of every day.

Instead, use the power of Windows Workflow Foundation combined with custom workflow activities. If needed, trigger these workflows using plug-ins and isv.config customizations.

Power user modifiable

A business process often involves users of different sorts and communicates with these using emails, tasks and other activites. The content of these and the recipients, sometimes dynamically set, sometimes static (like the CFO), might need to be changed. Therefore it is not very flexible for the customer if code has to be re-written everytime a mail has to be changed. It is a lot more flexible to create a workflow that creates the activity and then just execute the workflow from code, apart from the fact that it is a lot quicker to implement. Just write a method that enables you to execute the workflow by name instead of Guid.

Movable from environment to environment (dev-test-production)

All implementations of any notable size always includes at least three environements, not seldom up to 5 or 6 depending on how you count (local dev, central dev, test, training, production). Business process implementations have to be easy to move between solutions without any or with as little as possible environement specifics. Hence, try to use names (or some other environment indpendant value) instead of guids since guids are environment specifics when relating to workflows and other similar things. Try to get all environement specific settings in one place, one file or create an entity for them. This can be a challange but try, it will pay off in the long run.

These are my thoughts on the business processes implementation stategy concerning Dynamics CRM 4. I would be happy to discuss the topic so please leave comments!

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Automatic restart of Async Service

When developing new workflow activities for CRM 4.0 you need to release the filelocks on the dll to be able to copy the new dll to the assembly directory. This can of course be done manually by restarting the service in the service manager but can be scripted into the prebuild events aswell, so that it is more automatic. Add the following two lines to the Pre-build events of your workflow activity project to make it restart the MSCRMAsyncService:

net stop “MSCRMAsyncService”
net start “MSCRMAsyncService”

Please note that you might inflict any ongoing workflows by doing this so take care if it is a live production server.

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Quick create

As many of you know, in CRM 3 there is a special view of an entity form called quickcreate. This is used when you press “New” in a lookup window. For instance, on an account you can press: select primary contact, when the search dialog shows you can instead of selecting an existing contact press the new button and a “slimline” version of the contact form show with just the must-have and should-have fields available.

In CRM 4 this feature is not used any more and the complete form will always be shown in this case, however, the functionality hasn’t been removed. I tried to find some kind of reference to it in the SDK but couldn’t so I had a look in the original CRM code in CRM 3 and found how to do it.

To open a form as quick create, find the object type code (1 = account etc) and go to the URL:
http://[server:port]/[organisation]/_forms/QuickCreateReturn/quickcreate.aspx?crmFormSubmitObjectType=[objecttypecode].

For example, for account on the local machine when CRM is installed on port 5555 and the company is named “company”:
http://localhost:5555/company/_forms/QuickCreateReturn/quickcreate.aspx?crmFormSubmitObjectType=1

Since I couldn’t find any official reference to this in the SDK it is very possibly unsupported to do this but it works for now. Any hotfixes or similar might, but are not very likely to change this functionality, new versions of CRM like v.next are more likely to change/remove this functionality.

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com