none
How can I use a feature to deploy a form AND control what content type it inherits from?

    Question

  • I want to deploy a few dozen InfoPath forms and I want them all to inherit from a base content type.

    If I deploy the form using the standard publishing functionality I can pick the content type I want to inherit from and everything works fine.  Is there any way to do this when the form is deployed using a Feature? 

    When I try using a feature I can create the content type, hook the content type up to the xsn template in the FormServerTemplates library but it always opens in the client and never in the browser. 

    I followed the instructions in this blog: http://blah.winsmarts.com/2008-8-Deploying_InfoPath_2007_Forms_to_Forms_Server_-and-ndash_Properly.aspx?postID=469 with mixed results.  The content type that is created automatically by the InfoPath feature receiver opens in a browser but inherits from "Form". If I point my custom content type to the exact same xsn it always opens in the client?

    Any suggestions?  Thanks.
    Tuesday, August 04, 2009 3:54 PM

Answers

  • As a workaround I noticed the content type has a property called "RequireClientRenderingOnNew" which is set to "true" by default.  I switch it to "false" with some custom code and now my content type is opening in the browser and can inherit from a base class that I choose.

    Another thing I noticed is if the InfoPath form is hosted in a custom aspx page then the "RequireClientRenderingOnNew" doesn't have any impact and the form opens in a browser regardless - which is what I want.
    Tuesday, August 04, 2009 8:05 PM