Selecting corresponding data into another field in a repeating table - InfoPath Dev
in

InfoPath Dev

Selecting corresponding data into another field in a repeating table

Last post 01-15-2009 11:37 AM by infogulch. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-09-2009 02:46 PM

    Selecting corresponding data into another field in a repeating table

    Hi, I have two (main) fields in a repeating table. They are Product Number and Product Name. Their values are taken from my sql db. I want to keep their selections synchronized. So if someone selects a product number, it automatically fills in its corresponding name. And vice-versa: if someone chooses a product name, the product number field should update to reflect that change. I almost had it working. I created a rule on each control to change the value of the other field when it was changed. This is sort of what it looked like on the Number field: (no condition) Action: >> Set a field's value: prodName = @ITEMDESC[@ITEMNMBR = prodID] And the Name field: >> Set a field's value: prodID = @ITEMNMBR[@ITEMDESC = prodName] It worked great. That is, until I started adding more items to the repeating table. What happens is when the How can I select *only the current item* to change it's corresponding field? Thanks, ~infogulch (I'm using InfoPath 2003 on Win XP SP3)
  • 01-09-2009 09:05 PM In reply to

    Re: Selecting corresponding data into another field in a repeating table

    Though it would be slightly tricky, there is a way to do what you describe.  Before I get into that, can you show us the full XPath corresponding to these lines (click the show XPath checkbox in InfoPath) as they don't mean much in this state:

    prodID = @ITEMNMBR[@ITEMDESC = prodName]
    prodName = @ITEMDESC[@ITEMNMBR = prodID]

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-10-2009 09:02 AM In reply to

    Re: Selecting corresponding data into another field in a repeating table

    Sure, I'll remember to post XPath when possible from now on. Here they are:
      xdXDocument:GetDOM("Products")/dfs:myFields/dfs:dataFields/d:IV00101/@ITEMDESC[../@ITEMNMBR = xdXDocument:get-DOM()/my:RMA/my:productsInvolved/my:prodID]
      xdXDocument:GetDOM("Products")/dfs:myFields/dfs:dataFields/d:IV00101/@ITEMNMBR[../@ITEMDESC = xdXDocument:get-DOM()/my:RMA/my:productsInvolved/my:prodName]
    (Btw, I can't seem to make a newline in a post on this forum, and the help isn't loading for me. Could you advise me please? [the above is a list])
  • 01-15-2009 11:37 AM In reply to

    Re: Selecting corresponding data into another field in a repeating table

    Can someone help please? Do you still think this is even possible?
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.