Pass Parameter to an unopened form - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Pass Parameter to an unopened form

Last post 03-11-2009 08:00 AM by Svetoslav. 20 replies.
Page 2 of 2 (21 items) < Previous 1 2
Sort Posts: Previous Next
  • 04-20-2007 01:10 AM In reply to

    Re: Pass Parameter to an unopened form

    BTW - You can get the namespace definition form the script editor of your second form or use a method calles something like getNamespace, not sure though. Have fun with further development and keep on posting your questions.
    Listen to Motörhead cos they play Rock'n Roll :)
  • 04-20-2007 08:55 AM In reply to

    Re: Pass Parameter to an unopened form

    Thanks, nukkumatti.

    I did the same thing you did before. I copied the namespace from Salary form, but it generated error by saying duplicate definition.

    I must have done something wrong. Could you please tell me when I deal with namespace, what should I focus on to avoid such mistakes?

    Again, thank you very much.

    Troy 

  • 04-20-2007 10:52 AM In reply to

    Re: Pass Parameter to an unopened form

    Just catching up on this thread but I thought I would throw out an idea that might simplify this solution. From what I see in the screen shots, you are making it more complicated than it may need to be by having two forms.

    It appears you have two tables of data, one for Name and ID and the other for ID and Salary. Are these in a database? If so you could just use the table relationships and put it all in one form.    You can have one table as your main and then add an additional table with the ID as the key relationship.  This allows you to update either table, query, etc.

    Otherwise, I am not sure which list you are modifying, if at all but if the lists are not large you could load both and use filtering to view the appropriate records.

     Just thought I would throw that out, maybe you have other requirements that is justifying having two forms instead of one with multiple views, etc.

  • 04-20-2007 07:27 PM In reply to

    Re: Pass Parameter to an unopened form

    Thanks for reply.

    Two forms are required. The screenshots you see are not for real. It's just my sample database. 

  • 03-11-2009 07:38 AM In reply to

    Re: Pass Parameter to an unopened form

    Hello nukkumatti,

     

    I was reading this topic, because I have a similar problem. As a matter of fact I tried your code ( the 1st solution that you proposed) and it worked perfectly ( with my  variables). After that I used this method in my IP form, but it kept showing me an error message "". I am posting now my code:

    function CTRL90_5::OnClick(eventObj)

    {

     var secondFile = Application.XDocuments.NewFromSolution("Template location"); //the new template location on SharePoint

    var crNumber = XDocument.DOM.selectSingleNode("/my:myCR/my:crForm/my:crNumberInit").text; //the value on the 1st form,that I have to pass to the new o 

    var aiID = secondFile.DOM.selectSingleNode("/my:myAI/my:aiNumber"); //the place in the new form where i place the above value

    aiID.text=crNumber;

     }

    It seems that now it cannot select the field in the new form. It opens the new form, as well as select the the crNumber variable. But the last line gives me the error: " null " is null or not an object. From my point of view the error is that the variable aiID is not located by the XPath. It is very strange for me because the same method but with different variable name and Xpath worked perfect (for the Xpath  in this case I am sure that it correct). I am lost ... I need some help.

    Best regards,

    Svetoslav

  • 03-11-2009 08:00 AM In reply to

    Re: Pass Parameter to an unopened form

    Hello all,

     The method works just perfect. I have achieved my purpose. It was a stupid mistake that I havent updated my second(the new) form, and so the Xpath was not correct. Sorry for bothering you!

    I am very grateful for this site, that it provides perfect solutions to not so advanced users.

    P.S. I hope I will become :)

    Regards,

    Svetoslav

Page 2 of 2 (21 items) < Previous 1 2
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.