How to use custom InfoPath forms for SharePoint 2010 Document Sets
We've always been able to customize the NewForm.aspx, EditForm.asp and the DispForm.aspx and now, as you are probably aware, SharePoint 2010 provides the capability to modify Forms using InfoPath.This allows us to build much richer UI's for our lists including things like advanced validation and rules. What you may not know is that this capability is not supported for Document Set content types. I'm not sure why this wasn't included out of the box however we were able to create a custom solution to fill this gap.
We did this by creating a custom content type which has custom NewDocSet.aspx and EditForm.aspx forms. We then use the XmlFormView control to display our custom InfoPath form instead of using the DataForm web part.
Some Implementation Details
- You can use the Node Attribute of the Field element in order to promote properties
- Since Document Sets do not support attachments we store the form XML in a Note field
- We used a List property to store a link to the current version of the InfoPath form
- We also used a List property to allow the administrator to configure which node is used for the name
- The version of the InfoPath form that was used for creation is stored in the form XML in the "processing-instruction" section. We use that value to load the correct InfoPath form