Does anyone have any idea how to deploy an InfoPath Form (2007) as a Site ContentType programatically (script or object model)? I do not want the form published to Central Admin and FormServerTemplates, but rather a Forms Library created by a Web scoped feature. The intention is to be able to publish the form via script or code in order to deploy and test the form in dev/stage/prod environments.
Asked
Active
Viewed 1,948 times
1 Answers
0
Well, I had to cut bait. Seems the two links provided a workable solution for now.
Sahil Malik's articel here provided enough information to deploy the form and the data connection was a simple matter of adding a module to the elements file for the feature. Some tips for this can be found here
Howerver, it seems there is no way to deploy a form to anything other than a Site Feature. After diving into the assembly Sahil mentions with Reflector, there is a check in the code to ensure the Feature is Site scoped. Arrgghh. If anyone can explain why this is, and perhaps an alternative, I would greatly appreciate it! Hope this helps someone else.

Glorfindel
- 21,988
- 13
- 81
- 109

Pete Skelly
- 775
- 6
- 16
-
Hi Pete, I have a similar requirement but my form contains VSTA code meaning I need to publish the form to central admin(admin approved). I want to bypass the process and create a solution that does that using powershell script because I dont want administrator go through the process of uploading the form in central admin and activating to site collection. How did you go about this issue and how you solved it. – Kannan Karmegam Jan 30 '12 at 03:47