Read XML Field Value doesn't work - InfoPath Dev
in

InfoPath Dev

Read XML Field Value doesn't work

Last post 01-06-2012 02:50 AM by dchrist1. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 01-06-2012 02:50 AM

    Read XML Field Value doesn't work

    Hello everybody,

    I updated my infopath form and therefore I have a changed structure now. Before I changed it, the field compl_impl_enter_actual_year was within the group myfields and now it is within the group myfields/my:General_Information. That means I have a problem. I have two versions: 1: XML-Files which are based on the old structure and 2: XML-Files which are based on the new structure.

    Now I tried to use the following work around: If I open existing xml files (infopath forms) which are based on the old template I would like to check if the field in the xml field is already existing. If yes, I must set the "new" field during the form is loading. If the field doesn't exists nothing should happen:

    If thisXDocument.DOM.selectSingleNode("/my:myfields/my:implementation_actual_year").text = "Yes" Then 

     thisXDocument.DOM.selectSingleNode("/my:myfields/my:General_Information/my:implementation_actual_year").text= "Yes"

    Elseif thisXDocument.DOM.selectSingleNode("/my:myfields/my:implementation_actual_year").text = "No" Then

     thisXDocument.DOM.selectSingleNode("/my:myfields/my:General_Information/my:implementation_actual_year").text= "No"

    End If

    The problem is, that my code doesn't work. The code doesn't sets the field if the field exists within the xml-files. Do you know why it doesn't work? I use Infopath 2010, but Infopath 2003 templates.

     

    best regards
    Daniel

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