Tuesday, February 9, 2010

Server 2008 and the Email router with IFD

Today I encountered an interesting issue with Server 2008 and the email router. The email router is running on the same server as CRM, and I had just configured CRM to run in IFD mode. This somehow broke the email router. When browsing the CRM URL from the server, I received the IFD login page. Thinking I had missed a subnet, I confirmed that all appropriate subnets (including the server subnet) were included in the IFD tool, and verified it was working by testing from another server. Everything checked out.

And yet somehow, the request for CRM was coming from another IP not included in the subnet, but only when browsing from the CRM server itself. It turns out that the CRM server, when making the request to itself, was making that request using IPv6 instead of IPv4. The IP address was indeed different and was not in one of the included subnets. To resolve this issue, I disabled IPv6 on the ethernet connection (in the properties, I simply unchecked the IPv6 box) and tested again. Everything worked fine, and the router was fixed.

So if you are using an IFD, keep in mind that Server 2008 may try to make requests in IPv6 to itself, and the CRM server will think these are external requests.

Monday, February 8, 2010

Server 2008 and the IFD tool

Just a quick note today - if you try to run the IFD tool for CRM on a 2008 server, it might not work. You will get no error, no warnings, but the settings will not be applied... unless you run the tool explicitly as an Administrator. UAC strikes again!

Wednesday, December 2, 2009

Rollup 7 breaking workflow publishing?

I can't be certain, but I think Update Rollup 7 for CRM is breaking my ability to publish workflows that contain email steps. So far I have encountered this twice, for two different customers, and it is really annoying. Fortunately, I have found the solution!

The error that appears in the trace file (if you do a trace while attempting to publish the workflow) comes up something like this:
>Crm Exception: Message: Workflow compilation failed:
WF1399: Activity 'SendEmailStep5_policy' validation failed: Property "RuleSetReference" has an invalid value. Rule set is invalid. Rule "main" validation failed. Type System.Globalization.CultureInfo is not marked as authorized in the application configuration file.
WF1399: Activity 'SendEmailStep7_policy' validation failed: Property "RuleSetReference" has an invalid value. Rule set is invalid. Rule "main" validation failed. Type System.Globalization.CultureInfo is not marked as authorized in the application configuration file., ErrorCode: -2147201023

The error actually provides a clue as to the problem, but it wasn't entirely obvious to me. There is a line missing from the web.config file which, when added back, resolves the issue. The line is:
<authorizedtype assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" namespace="System.Globalization" typename="CultureInfo" authorized="True"></authorizedtype>

I've just been adding it to the end of the list of authorized types for mscorlib. You don't even have to restart IIS - it just begins working as soon as you save the file.

UPDATE: I had to put in the HTML escape characters for the brackets to show up in here - my apologies for the line not appearing before!

Friday, October 30, 2009

SQL functions to convert between bases

So I had an application where I wanted to convert between decimal and hex values, and while I found a few ways to do this with SQL, they didn't really give me what I wanted (the varbinary datatype is NOT what I was looking for). The largest issue was that the way the javascript on my CRM form converted to hex and the way SQL converted to hex were apparently not the same, and it was very annoying.

Thankfully, I found a couple of fantastic blog posts that help with this. Mr. Caldwell has created 2 functions for converting into and out of different bases, and they work wonderfully (and the same way that javascript does):
Convert Decimal to any other base
Convert any base to Decimal

Note that these are designed for SQL 2005 or above - I was able to apply one of the functions to SQL 2000 by changing the varchar(max) to varchar(255) (which was large enough for me.

Thursday, October 29, 2009

Cool script to display associated records in an iFrame

I found a few of these scripts that applied to CRM 3.0, but for 4.0, this blog post has a simple and easy to configure script for displaying related records (like the contacts under an account) in an iFrame. You only need to change the values at the top and the script does the rest!

http://mscrm4ever.blogspot.com/2009/05/crm-40-show-associated-view-in-iframe.html

Monday, August 31, 2009

CRM Email Router and Forms Authentication

One of the single-most annoying issues when trying to get the CRM email router up and running is when you are trying to get the incoming connector to work and the OWA site in Exchange is set up to use Forms Authentication (which is nice for end users and doesn't work at all with the email router). The easiest solution I have found for Exchange 2007 is to simply create a second OWA site using Integrated Authentication and just use that for the email router, leaving the standard OWA site for end users and Forms Auth.

To this end, I will refer to a blog post here: http://blog.networkfoo.org/?p=195

This post has a list of handy PowerShell commands you can run to create the new site and all the information you need to configure it with the email router. This site has helped me a number of times, and I'm posting it here mostly as a bookmark for myself so I don't lose it again!

In case this post ever goes away, the meat of the article is the following 4 commands (create a new IIS website FIRST):
  • New-OwaVirtualDirectory -OwaVersion:Exchange2007 -Name “owa” -WebSiteName “OWA-CRMRouter”
  • New-OwaVirtualDirectory -OwaVersion:Exchange2003or2000 -Name “Exchange” -WebSiteName “OWA-CRMRouter” -VirtualDirectoryType:Mailboxes
  • New-OwaVirtualDirectory -OwaVersion:Exchange2003or2000 -Name “Exadmin” -WebSiteName “OWA-CRMRouter” -VirtualDirectoryType:Exadmin
  • New-OwaVirtualDirectory -OwaVersion:Exchange2003or2000 -Name “Exchweb” -WebSiteName “OWA-CRMRouter” -VirtualDirectoryType:Exchweb
There is also more information on this page:
http://technet.microsoft.com/en-us/library/bb124811.aspx

Wednesday, August 19, 2009

Mappings between product line items

So this is a problem I've had to look up every time I have it, so I'm posting it here as a way to keep track. In order to map attributes between product line items (opportunity product to quote product to order product to invoice product), you have to access the secret mapping URL to set it up. Steps to perform:

1. Find the GUID of the mapping you need to edit. In the Org_MSCRM database, run this query:
select * from entitymapbase where targetentityname = 'salesorderdetail'
Obviously, you might need to change the target entity value - the above will return all of the relationships where the order line item is the target. This returns a column that shows the "source entity name", so for a mapping from quote product to order product, pick the line where the source is "quotedetail". Copy the EntityMapId from this row.

2. Enter the following URL into IE (modified with your servername):

http://[servername]/Tools/SystemCustomization/Relationships/Mappings/mappingList.aspx?mappingId=[GUID]
Be sure to replace your server name for CRM, and put the GUID from step 1 at the end.

3. Create mappings and repeat as necessary!