Passing data between forms - InfoPath Dev
in

InfoPath Dev

Passing data between forms

Last post 01-07-2014 09:47 AM by craig.j.comeau. 24 replies.
Page 1 of 2 (25 items) 1 2 Next >
Sort Posts: Previous Next
  • 03-20-2006 11:41 AM

    Passing data between forms

    Is it possible to pass certain fields of data from one form to another when a rule on the form is set to use the "open the following form" action? I have form1 collect time and date information and when a certain option button is checked, the action is to open a new form. The new form requires the same date and time information and I don't want the users to have to perform redundant actions.
  • 03-20-2006 12:39 PM In reply to

    Re: Passing data between forms

    Hi JimDandy,

    Yes you can do what you need to do with InfoPath. Here is a good "how to" from Greg Collins that should get you started on how you can do this:


    http://www.infopathdev.com/howto/tutorials/default.aspx?i=5387945327d4477089eb9cfea1e8858f
  • 03-30-2006 01:06 PM In reply to

    Re: Passing data between forms

    But...

    Does anyone know how to get the "supporting" form to pass data back to the original form?

    For instance, I push a button on "Form A", which can create a new "Form B". The user fills out Form B and clicks "Save". Is there some way to send data from Form B back to Form A without saving/closing/updating/reopening Form A?

    Any thoughts on this would be appreciated - unfortunately, using different views is not an option for me.

    Thanks.
  • 03-31-2006 12:54 AM In reply to

    • Sash
    • Not Ranked
    • Joined on 03-30-2006
    • Posts 15

    Re: Passing data between forms

    quote:
    Originally posted by anotherchrisberry

    But...
    Does anyone know how to get the "supporting" form to pass data back to the original form?



    Well, I just have found the same problem. I solved it using Application object and XDocuments collection. So the problem is how to pair two forms in order to the latter form knows the destination for returning data.

    Let's both forms (main and supporting) have an attribute that keeps the former (main) form's Id, which can be generated by anyway. I set this value when the supporting form is created. The supporting form is awared of the main form's DOM structure. When it is time to return data, the supporting form is looking for the required form in Application.XDocuments collection by checking the Id attribute.

    For demo purpose, I supposed that we have only two forms and no need to search in Application.XDocuments collection. So we can use the main form number as the form Id. So the latter form executes the following code before it is closed:

    objSource = Application.XDocuments(SourceId); // SourceId is 0.
    //We don't need to search for the Source as we have only two forms running.
    objSource.DOM.selectSingleNode("/my:myFields/my:Name").text =
    XDocument.DOM.selectSingleNode("/my:myFields/my:field1").text;

    Application.ActiveWindow.Close(true);

    Well I am a newbie in Infopath and am not sure that's the best solution. Hope others could offer other ways.

  • 03-31-2006 06:47 AM In reply to

    Re: Passing data between forms

    If you have similar data, it is usually a good idea to use multiple views within one form. Is there any reason you cannot do it this way?

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 03-31-2006 01:10 PM In reply to

    Re: Passing data between forms

    Sash, I'll give that a try. It looks like exactly what I want.

    Unfortunately, I can't use different views, because I'd be pulling in a few hundred schemas for all the templates that make up the subforms.

    Thanks, guys!
  • 05-29-2013 08:53 AM In reply to

    • WP_Adam
    • Not Ranked
    • Joined on 05-27-2013
    • Canada
    • Posts 6

    Re: Passing data between forms

    I was reading through the identified blog and noticed that it is only for 2003, is there a solution for 2010 forms? Also are there any plans on adding this ability to qrules?
  • 07-10-2013 10:47 AM In reply to

    • WP_Adam
    • Not Ranked
    • Joined on 05-27-2013
    • Canada
    • Posts 6

    Re: Passing data between forms

    For 2010 the below works for passing information to another form.  Just have to figure out how to pass back without closing and reopening the original form.

    http://social.msdn.microsoft.com/Forums/en-US/96f71ce6-1544-4f8d-a81b-f21eee710daf/passing-data-between-infopath-forms-without-saving

    It also list a way to tamper-proof data being passed.

    http://aspnet.4guysfromrolla.com/articles/083105-1.aspx

  • 07-13-2013 02:15 PM In reply to

    Re: Passing data between forms

    Hey good timing!

    I did a webinar on this technique last Thursday. qRules supports getting input parameters so for those of you who don't want to write code (which could break when your form changes), I recommend that approach, but there is one other approach which is to use a library column as your clipboard. That's demo #2 from my weekly webinar last Thursday. http://youtu.be/fVK-PDmcqRU

    Patrick Halstead
    Project Manager at Qdabra
  • 07-15-2013 07:53 AM In reply to

    • WP_Adam
    • Not Ranked
    • Joined on 05-27-2013
    • Canada
    • Posts 6

    Re: Passing data between forms

    Thanks, I will take a look.

  • 07-31-2013 11:11 AM In reply to

    • WP_Adam
    • Not Ranked
    • Joined on 05-27-2013
    • Canada
    • Posts 6

    Re: Passing data between forms

    Work is blocking the video (have had time to watch at home), but I did get qrule setup and it pass data between the forms with one issue, it braking the data connections.  If I open the form with no parameter, the data connection work fine.  I have to "GetInputParameter" qrule setup on finish loading field.

  • 08-01-2013 12:47 AM In reply to

    Re: Passing data between forms

    Should work fine. There may be a warning in the design checker, but you can ignore that.

    What data connection are you using? The GetInputParameter stuff doesn't actually use a data connection. In other words, you can verify independent of any data connections.

    Assuming the input parameter is passed, you can then set the query fields and query the data connection and get the data you need. 

    I'm happy to help you debug this in an online meeting. Just send email.

    Patrick Halstead
    Project Manager at Qdabra
  • 01-02-2014 09:16 AM In reply to

    Re: Passing data between forms

    Hi Patrick,

    I am trying to pass a value between 2 infopath forms. They are on a network drive, same folder for testing purposes. The error i get when the target form opens in the qrules error field is Parameter not recognized: /key=name. Simple forms with no data connections. All i have on the form is the field "name".Just simply trying to pass a value. Looking to purchase the rules if i can get this working. Looks like a very useful tool.

  • 01-02-2014 09:20 AM In reply to

    Re: Passing data between forms

    Hi - sounds like there may be a problem with your qRules command. What is the syntax of the command you are using in the target form? When does the command execute?

    Hilary Stoupa

  • 01-02-2014 09:31 AM In reply to

    Re: Passing data between forms

    I am using the finishedloading parameter in qrules with a rule that says finishedloading=true and 2 rules after that. set a fields value is GetInputParameter/key=name  and set a fields value name=result.
Page 1 of 2 (25 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.