new row in repeatable table with different values in each rows - InfoPath Dev
in

InfoPath Dev

new row in repeatable table with different values in each rows

Last post 10-02-2008 12:04 AM by Shiva. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-30-2008 08:58 AM

    • uteco
    • Not Ranked
      Male
    • Joined on 09-11-2008
    • Greece
    • Posts 1

    new row in repeatable table with different values in each rows

    Hi everyone.
    Very short, this is my first request I have placed in my life asking for help, accepting the fact that there are some things I can not figure out myself and b) some things do not seem to be covered yet!

    Here is my problem.

    I have a form, which gets its data from a MS SQL database.

    In a repeatable table I have a first row with five fields.

    I want to be able to type a code in the first field(which is an item number of my SQL database) and have all the other fields automatically filled in with the according data.

    So each of these fields have:

    xdXDocument:GetDOM("Products")/dfs:myFields/dfs:dataFields/d:MATERIAL/@DESCRIPTION[xdXDocument:get-DOM()/dfs:myFields/my:items/my:productCode = ../@CODE]

    which means the fields check against the user input data of the first field and returns automatically the acording fields of the SQL database row and column to these fields.

    Do I make sense ?!!

    Ok , all works fine until I add a new row.

    When I put a new number in the first field all other fields return the right data  ... but the previous row get the same content in all fields too.

    I understand that I must have a mistake the way I ask all fileds to be populated by just asking to look at the first field compare it with the acording column in the SQL database as every row will have exactly the same request and the first filed (user input field) still are the same to them so they update always with the latest input data.

    Is it possible to avoid the update of previous rows when a new row is added ?

    I have VERY little knowledge in XML and VB.

    I have seen some answers close to what I want but all refer to scripts which I do not even know where to add them!!

    Any simple solution would help me avoid losing another week trying all possible combinations !

    Thanks in advance, and sorry for my poor way of expressing my problem.

     

  • 10-02-2008 12:04 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: new row in repeatable table with different values in each rows

    Hello Welcome to the Forums,

    Here is the on after change event code below,

    if(e.UndoRedo || e.Operation != "Insert" || fIsUpdatingFields == true)
            return

        fIsUpdatingFields = true
        // Update the previous rows here
        fIsUpdatingFields = false

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