Deploying Browser forms to Subsite with dynamic submitting - InfoPath Dev
in

InfoPath Dev

Deploying Browser forms to Subsite with dynamic submitting

Last post 09-02-2009 11:49 PM by Patrick Halstead. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 09-01-2009 01:35 PM

    • rybocf
    • Not Ranked
    • Joined on 09-01-2009
    • Posts 3

    Deploying Browser forms to Subsite with dynamic submitting

    Hi everyone,

    I'm trying to build a series of InfoPath 2007 forms (Forms Services) for SharePoint.  The problem is that although these can be deployed centrally to the site collection, there is a problem with saving the forms.  What we are doing is building a custom site definition that will create N number of subsites.  These subsites are using form/document libraries with content types that are based off the deployed forms.  Oddly enough this all works great, except:

    We want the forms to save locally in the local subsite library from which the content type is used.  I have traditionally used a submit button tied to a data connection (UDCX or hardcoded, doesn't matter) to tell the form where to save itself.  Obviously this is a problem because the location in which the form was instantiated determines where it should be saved.  So, I decided to used a custom data connection in the local sharepoint subistes that each form should be able to look at relative to it's own location and that UDCX could be customized when the subsite was created. 

    This seems to work too, except I didn't realize that forms server creates its instance of the form from the central library in which it is stored.  This means that it can't look and find the UDCX file local to it's subsite. 

    So I took a different path and tried to deploy the forms as part of a feature with the local subsite site definition and then would build the content types locally.  It turns out I can't get the forms to be browser enabled without deploying it the way SharePoint wants (using the Microsoft.Office.InfoPath.Server.Administration.XsnFeatureReceiver class) referenced in this article:  http://blah.winsmarts.com/2008-8-Deploying_InfoPath_2007_Forms_to_Forms_Server_-and-ndash_Properly.aspx  So although I can deploy them to subsites like this, they won't load in a browser unless they are activaetd via that FeatureReceiver.  Oh yeah, and that class won't let you deploy to an SPWeb object, only SPSite.  So I was back to square one.

    I hope all this made sense, but now I'm trying to find a way to re-use forms across many sub-sites and tell those forms to save in the location from which they were originated (library).  I'm more an expert at SharePoint than I am at InfoPath, so I'm hoping that there is some coding enabled in browser forms or ways to dynamically tell forms server how to save/submit to a data connection.

     Thank you for any help you can provide!

    -Ryan Thomas

  • 09-02-2009 12:58 AM In reply to

    Re: Deploying Browser forms to Subsite with dynamic submitting

    The UDCX must be at the root of the site collection and your formp library can be in a subsite.

    You just have to put the right URL in the UDCX and don't forget to put the UDCX at the root.

     

    Rémi

    Rémi MATAYRON / MVP InfoPath
    Visit my blog : Infopath Blog
  • 09-02-2009 06:32 AM In reply to

    • rybocf
    • Not Ranked
    • Joined on 09-01-2009
    • Posts 3

    Re: Deploying Browser forms to Subsite with dynamic submitting

    The problem with that is I need individual UDCX files tell the forms from each site where to save.  A single UDXC won't work because (unless I'm wrong) it can only submit to a single location.  The only thing I found that may work (digging last night) is using code in the forms to change the submit location dynamically.  I was under the impression that browser forms could not use code, but I have seen a couple blog posts that say you can.

     Thanks,

    -Ryan

  • 09-02-2009 07:03 AM In reply to

    Re: Deploying Browser forms to Subsite with dynamic submitting

    you can use below code to submit dynamically

    XPathNavigator xn = this.MainDataSource.CreateNavigator();

    XPathNavigator xnSaveLocation = xn.SelectSingleNode("/my:myFields/my:MySubmitLocation", this.NamespaceManager);

    FileSubmitConnection fc = (FileSubmitConnection)this.DataConnections["Main submit"]; //replace with with the name of your data connection

    fc.FolderUrl = xnSaveLocation.Value.ToString();

    fc.Execute();

    e.CancelableArgs.Cancel = false;

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 09-02-2009 11:00 AM In reply to

    • rybocf
    • Not Ranked
    • Joined on 09-01-2009
    • Posts 3

    Re: Deploying Browser forms to Subsite with dynamic submitting

    Thanks.  I am now trying to figure out how to deploy browser-enabled forms with their associated assembly (code-enabled) to SharePoint as a feature.  From the error messages it looks like I have to package the assembly with the feature so it can find it in the feature folder.

     Thanks!

    -Ryan

  • 09-02-2009 10:38 PM In reply to

    Re: Deploying Browser forms to Subsite with dynamic submitting

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 09-02-2009 11:49 PM In reply to

    Re: Deploying Browser forms to Subsite with dynamic submitting

    Cool link. Thanks!

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.