Issue with repeating section field value - InfoPath Dev
in

InfoPath Dev

Issue with repeating section field value

Last post 01-11-2010 12:54 PM by blue_psychedelic. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-06-2010 01:02 PM

    Issue with repeating section field value

    Hi all, hoping someone can help me.

    I have a browser-enabled, site-admin approved InfoPath form running on SharePoint 2007 with IPFS. In part of the form, there is a repeating section that contains fields to gather personal information. The idea is that a unique ID is entered, and the person's corresponding name pops up in two text fields ("first name" and "last name") at the push of a button. This is done with VB.NET code behind, calling a webservice to retrieve the data form an Oracle Database.

     The issue we are having is that the it works fine in the client applicant, (when debugging, or running the form inside InfoPath); during tests, if an ID is entered, and the first and last name pop up without an issue when you click the button, for each instance of the repeating section.

    But when we deploy through central admin, and then open the form the broswer, hitting the button does the following:

    1) On the first instance, returns the proper, corresponding name for both fields..

    2) On the second and subsequent instances, returns only the last name.

       I don't know where to begin solving this one.

     

  • 01-07-2010 01:36 PM In reply to

    Re: Issue with repeating section field value

    Hi blue_psychedelic,

    I'm new to InfoPath and I learned a lot from this forum. So to return the favor, I just wanted to help out others as well... in my own little way.

    So going back to your problem, is your form hooked directly to the database? If so, have you tried using rules instead of manually coding to accomplish the same functionality?

     

  • 01-07-2010 10:15 PM In reply to

    Re: Issue with repeating section field value

    would you mind pasting that peice of code here so that we know what is going

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 01-11-2010 12:54 PM In reply to

    Re: Issue with repeating section field value

    As an update: We have spent much time debugging on the server. The only thing we've gleaned is that the data is pulled from the table, that it's set to the right fields, but the movement of the selector is not recognized, for some reason. But why on earth does it work for the first instance of the repeating section, or work just fine while in the InfoPath client, we are at a loss.

    As requested, here is the code that loops through the repeating section on a user-button click. The code is the same for all five section, and runs each time the button is pressed.

    *variable declarations*

    nodes = docXN.SelectSingleNode("/my:myFields/my:AddAddlInstructor", Me.NamespaceManager)
                go = nodes.MoveToChild("AddlIISection", nodespace)
                strHoldNodesValue = nodes.Value
                IIErrorMsg.SetValue(" ")

                While go
                    nodes.MoveToChild("InstID", nodespace)
                    Dim testnumericvar As String
                    Dim testnumeric As Boolean
                    Dim sqlStmt10 As String
                    Dim strIDNumber As String = 0
                    Dim strHoldNodeInfo As String

                    IIErrorMsg.SetValue(" ")
                    testnumericvar = nodes.Value
                    testnumeric = IsNumeric(testnumericvar)
                    If testnumeric = False Then
                        IIErrorMsg.SetValue("Instructor ID is not Numeric")
                        Exit Sub
                    Else
                        IIErrorMsg.SetValue(" ")
                    End If
                    strIDNumber = nodes.Value
                    sqlStmt10 = "select last_name, first_name, id " & _
                                 "from tablename" & _
                                  "where id = '" & strIDNumber & "'" 

                     ds = service.GetData(tablename10, sqlStmt10)
                                   If ds.Tables("instructor").Rows.Count = 0 Then
                        IIErrorMsg.SetValue("Instructor Not Found")
                        InstFirst.SetValue(" ")
                        InstLast.SetValue(" ")
                        Exit Sub
                    End If
                    myrow = ds.Tables("instructor").Rows(0)

                    If ds.Tables("instructor").Rows.Count <> 0 Then
                        myrow = ds.Tables("instructor").Rows(0)

                        nodes.MoveToPrevious()
                        strHoldNodeInfo = nodes.MoveToPrevious()
                        nodes.SetValue(myrow("first_name").ToString())
                        strHoldNodeInfo = nodes.MoveToPrevious()
                        nodes.MoveToPrevious()
                        nodes.SetValue(myrow("last_name").ToString())
                    End If

     

    Any and all help is appreciated in this frustrating form.

     

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