I've been playing around with publishing an InfoPath form to a SharePoint site as a content type to try and see what happens. It works okay in that updating a form instance in a library will update the library columns. Short of the promoted properties in InfoPath however I can't see how this mapping works.
My aim is to have a CAML defined content type as part of a WSP. The content type will install preconfigured having the promoted fields from InfoPath. There will be some additional fields not in the form but needed in the content type for the workflow that will run when these forms are filled in. Actually the extra fields in the content type arn't critical, one step at a time.
I've tried specifying the promoted fields in the form options and network publishing. Then creating a form content type by hand through the website and linking it to the uploaded form template. I would hope that when the form runs it would check the list and create the columns but it doesn't do that. I've also tried SharePoint publishing the form as a content type, then creating my own content type that references the template URL where it was published. Creating the site columns by hand and linking them in with my content type. Whatever way I try it the InfoPath forms don't link the promoted fields to the columns I've created.
So short of publishing properly through InfoPath I can't get this mapping working myself. Really I'm trying to reproduce what the SharePoint publishing does without understanding how it maps the fields. If I can't do it through the website I'm hardly going to get it going with CAML and have this as a single installable solution where a customer would be able to activate the WSP and have the site, libraries, content types, lists, forms, workflows pre-created and all set up ready to use. I already do this with other projects just not with actual forms libraries.
Any advice would be very much appriciated.
[EDIT] If it comes to it I might have to resort to (shudder) having some code in the form that on close would write particular fields to the list and do away with the "promoted fields" altogether in favour of my own may of doing it with which would admittedly be worse but it would work.