Before/After properties not available for InfoPath content types in Form Library - MOSS 2007

I wanted to blog this as an FYI... So, I will try to deliver the message short.

When we publish an InfoPath 2007 form template to a MOSS 2007 server, we have an option to choose to publish field in the InfoPath template (as content types), which makes InfoPath fields available as columns in form library.

This is a useful feature, however, if you intend to use custom event handlers in that form library, that "type" of publishing is something you don't want to do.

Why? Because these fields that are exposed by the form library (actually the InfoPath template) aren't correctly recognized by the SPItemEventProperties object. On a form library that has a column provided by InfoPath template, you will see the Before/After properties are empty.

The reason appears to be the way these columns are understood. I guess, the Before/After properties "look out" for SPField types. Since the columns provided by form template isn't of type SPField, (I guess that should be SPContentType?) the SPItemEventProperties don't bother to record the current object's Before/After properties.

A simple fix: Don't choose "make the InfoPath fields available as column in document library".

Another simple fix: Create columns in the form library instead of allowing InfoPath to supply them for you!

Searched in the cyber space but couldn't find enough information on this - so doing my little part :)