Copying Repeating Data From XML Ext Src into Main Data Source - InfoPath Dev
in

InfoPath Dev

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

Copying Repeating Data From XML Ext Src into Main Data Source

Last post 09-03-2012 12:09 PM by Gennady Vanin (Геннадий Ванин, Новосибирск). 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-01-2012 11:18 PM

    Copying Repeating Data From XML Ext Src into Main Data Source

     I successfully run the code

    •  Hilary Stoupa How to Copy Repeating Data From an External Source into My Form
      http://www.infopathdev.com/blogs/hilary/archive/2008/07/04/how-do-i-copy-repeating-data-from-an-external-source-into-my-form.aspx
      Sample download
      http://www.infopathdev.com/files/folders/examples/entry30104.aspx

     in Infopath 2010

    But when I try to repeat the described step by step the code failing.
    Checked the execution in debugger but could not find the differences between my failing  and succeeding (enclosed by Hilary sample) form and code as well as the reason of failing of my form code.

    Any ideas?

    Gennady Vanin (Novosibirsk) --- Геннадий Ванин (Новосибирск)
  • 09-03-2012 10:00 AM In reply to

    Re: Copying Repeating Data From XML Ext Src into Main Data Source

    The reason the code isn't working is that the my: namespace in the XML you're constructing is different from the form's my: namespace.  Once that's fixed, a remaining issue is that the capitalization on your <my:DealerID> tags is incorrect.  Fixing those should make the code run correctly.

    Jimmy Rishe / Software Developer / InfoPath MVP
    Qdabra Software
  • 09-03-2012 12:09 PM In reply to

    Copying Repeating Data From XML External into Main Data Source

    Jimmy!

    Oh, my

     Manyyyyy thaaaaaaaaaaanks!

    Jimmy:
    a remaining issue is that the capitalization on your <my:DealerID> tags is incorrect
     

    This I saw, correcting it did not help. Though, honestly, I forgot to recall that capitalization makes difference in XML, so I eventually neglected it

    Jimmy:
    The reason the code isn't working is that the my: namespace in the XML you're constructing is different from the form's my: namespace.
     

    Well, in other words, the article

    should have mentioned to replace  http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-06-03T00:09:57 in

     string vehicleXml = "<my:Vehicle  xmlns:my='http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-06-03T00:09:57'>"
                                        + "<my:Year>" + year + "</my:Year>"
                                        + "<my:Make>" + make + "</my:Make>"
                                        + "<my:Model>" + model + "</my:Model>"
                                        + "<my:Color>" + color + "</my:Color>"
                                        + "<my:Dealers>";

    by value from Infopath form (right-click myFields from Main Data Source > Properties > Details)

     


    Gennady Vanin (Novosibirsk) --- Геннадий Ванин (Новосибирск)
Page 1 of 1 (3 items)
Copyright © 2003-2012 Qdabra Software. All rights reserved.
View our Terms of Use.