Publishing SharePoint Content Type from InfoPath

Beware of the publishing wizard in InfoPath 2007.  I was working on a project recently and the developers had customized there WSS 3.0 AllItems.aspx.  Each time they published a new copy of the InfoPath form complete with promoted properties they had to go through and update the field names in AllItems.aspx.  In addition they had to go tweak the document libraries using this content type so the views would display with the correct field.  This was tricky as all hell, when tweaking the document library they would see 3-4 versions of the same field with the same display name.  Yuk!

InfoPath was obviously creating new site columns when the content type was being published.  First step I took was to drop the content type.  You’ll need to remove all references to it so remove it from each of the document libraries using it.  Now delete the content type then clean up the site columns.  Both these tasks can be found under the site settings from the site actions button in SharePoint.

IMO the best approach is to create the site columns manually then map to those site columns when publishing the content type.  I created a new site columns group to contain the columns specific to this InfoPath template.  Again this can be accomplished through site settings within SharePoint.  Then from InfoPath designer I fired up the publishing wizard and chose to deploy the content type to my SharePoint server.  When you get to the below step in the wizard DO NOT just hit next.  If you do InfoPath will create a new site column for the field called for example GroupId1, GroupId12, GroupId123, etc…  The InfoPath publishing wizard will query what the last field name was and appended a character to it.  So instead hit the modify button and map each of your fields to the already created site columns.  This of course means those modified AllItems.aspx forms don’t need to be manually changed to support the new field names every time the content type is published.  It also means the document libraries are not impacted.  

Advertisements
This entry was posted in SharePoint. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s