Configuring Internet Facing Deployment for Microsoft CRM 4.0

After running the tool to configure the CRM website for an Internet Facing Deployment (see the articles here and here) we got the old familiar Runtime Error: Server error in / Application. We turned on remote errors and saw the underlying error message was even less helpful: “Object reference not set to an instance of an object.”

After some digging, it turns out there was a registry key on the CRM server that incorrectly identified the identifier of the CRM website in IIS.

The ‘website’ registry key at \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM had a value of ‘/LM/W3SVC/1’ and it should have been ‘/LM/W3SVC/5’

You can see the identifier for the CRM website in this screen capture from IIS:

All we had to do is navigate to the registry key and change the value to reflect the identifier that we saw in IIS.

Change Left Nav Links to Point to Custom Associated Entities

In an earlier post, I talked about the shortcomings of the out-of-the-box Address entity. In a recent project, we replaced the system Address entity with a custom Address entity. When we added a 1:N relationship for Contacts:New_Addresses, the link to the new address entity showed up on the left hand nav of the Contact form, as expected. However, it was added at the bottom of the left hand nav links under the “Workflow” link.

We wanted to keep the Addresses link where it was, but load the associated view of our custom entity instead. So when a user clicks on the “More Addresses” link, they will see the list of custom address records, rather than the out-of-the-box addresses. Here’s the OnLoad code we used:

// load the custom address entity instead of the system addresses
// in the associated view
// I used the IE Developer Toolbar to find the id of the custom entity’s loadArea

if (document.getElementById(‘navAddresses’) != null) { document.getElementById(‘navAddresses’).onclick = function() { loadArea(‘new_contact_new_address’) };

// Hide the link to the custom address entity that was added under the workflow link
// when we created the 1:N relationship

if (document.getElementById(‘nav_new_contact_new_address’) != null) { document.getElementById(‘nav_new_contact_new_address’).style.display = ‘none’;