current() confusion - InfoPath Dev
in

InfoPath Dev

current() confusion

Last post 02-07-2008 04:51 PM by Greg Collins. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-04-2008 09:23 PM

    current() confusion

    Hi,

     I have a repeating table where I want to populate a field via a secondary data source based on a selection in a drop down list.

     The code below works but comes with the problem that subsequant rows are connnected to the first rows data.

    xdXDocument:GetDOM("Income")/dfs:myFields/dfs:dataFields/d:Income/@BAS_Related[../@Income_Item = xdXDocument:get-DOM()/my:myFields/my:Repeating/my:ITR/my:Label]

     I understand that I have to use the current() function but I can't seem to get the syntax right. I have tried all variations of where to put current() into the path without luck. I have also tried including  /../ into the path as well with the same result.

     Any suggestions greatly appreciated.

    Iain

  • 02-07-2008 04:51 PM In reply to

    Are you using rules? In a repeating table, current() will either be pointing to your row or to the field, depending on how you have things set up.

    I'm not sure whether my:Repeating is the actual repeating row or the container and my:ITR is the repeating row.

    You can try one of the following (assumes current() = the row):

    xdXDocument:GetDOM("Income")/dfs:myFields/dfs:dataFields/d:Income/@BAS_Related[../@Income_Item = current()/my:ITR/my:Label]

    xdXDocument:GetDOM("Income")/dfs:myFields/dfs:dataFields/d:Income/@BAS_Related[../@Income_Item = current()/my:Label]

    If those don't work, try one of these (assumes current() = the field):

    xdXDocument:GetDOM("Income")/dfs:myFields/dfs:dataFields/d:Income/@BAS_Related[../@Income_Item = current()/../my:ITR/my:Label]

    xdXDocument:GetDOM("Income")/dfs:myFields/dfs:dataFields/d:Income/@BAS_Related[../@Income_Item = current()/../my:Label]

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