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