Submitting multiple forms with one button - InfoPath Dev
in

InfoPath Dev

Submitting multiple forms with one button

Last post 04-26-2006 08:50 AM by Matt Faus. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 04-19-2006 06:42 PM

    Submitting multiple forms with one button

    With my current project there are a series of forms that are grouped together. Among these is one main form that ties all of the other ones together. I would like to make it so that submitting the main form will submit the other forms as well. In addition, any given form may or may not be submitted depending on if it is marked as "completed" on the main form or not.

    Is this type of functionality possible? And if so, where might I get some ideas about how to do this?

  • 04-19-2006 09:23 PM In reply to

    Re: Submitting multiple forms with one button

    Hi Mairen,
    Do you mean multiple InfoPath forms or multiple views within one form? Both scenarios can be batch-submitted, but the latter is much simpler. Please let me know and I'll respond with some ideas.
    Patrick Halstead
    Project Manager at Qdabra
  • 04-22-2006 03:58 PM In reply to

    Re: Submitting multiple forms with one button

    Multiple forms.
  • 04-24-2006 01:46 PM In reply to

    Re: Submitting multiple forms with one button

    any ideas would be appreciated
  • 04-24-2006 07:32 PM In reply to

    Re: Submitting multiple forms with one button

    Hi again,
    Sorry for delay in getting back to you. If the forms are all built from the same XSN file, you can use merge forms. There are two ways to consider - manual (where the user indicates which forms to merge) and automatic (where some logic in the form goes out to a file share and imports all of the forms). Assuming that the file share is in the same domain (and not on your local computer), you can use a form deployed with default domain trust security for both. Merge forms requires a data source that supports aggregation.

    Another method is to attach the other forms as file attachments. This is not as useful because the XML data is not as available to downstream line of business processes. I don't know if you have a downstream application that needs to process the forms or not, but you can either manually attach (use a repeating section with a file attachment in it), or programmatically loop through and attach the files (more work). You could even attach links to the files, but not sure that is useful. If the forms are not from the same XSN, you can still use the file attachment technique.

    Personally, I recommend merging the forms, but that requires a data source that supports merging.

    You can create logic that opens the other forms and submits them as part of your submit. That's much more work though, but if you don't have a data source that aggregates, or if file attachment isn't useful, that is one other option.

    Good luck!
    Patrick Halstead
    Project Manager at Qdabra
  • 04-25-2006 07:16 PM In reply to

    Re: Submitting multiple forms with one button

    Currently we are working with 3 forms, though we would like our project to be expandable enough to include more. Each of these was created from scratch and are not part of the same xsn. They are conceptually related, but not currently programatically related in any way.

    The design our user has in mind is that clicking submit on the main form will submit the main form and related forms that have been filled out without opening up the related forms in a window. The main form with have access to a series of booleans that will say if each related form should or should not be submitted (appears as a radio button slection to the user) and a list of the xml filenames of the related forms.

    I'm not understanding how the file attachment can help me accomplish this. Or is what I'm describing not possible?
  • 04-26-2006 08:50 AM In reply to

    Re: Submitting multiple forms with one button

    If the main form knows the XML filepaths of the other forms it shouldn't be too hard to write a script that will go through and submit each one of them.

    This is just a rough sketch, but I think the following JScript would work to submit the different forms.

    //Start the application
    var oApp = new ActiveXObject(”InfoPath.Application”);

    //Open an InfoPath document from an XML file
    var oXDocumentCollection = oApp.XDocuments;
    var oXDocument = oXDocumentCollection.Open("C:\path\to\related\form.xml");

    // Submit the form
    oXDocument.Submit();

    I haven't tested this, but it seems like it would work, please let us know how things work out!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.