Hi!
I'm trying to use the count() function within a repeating table on a filtered secondary data source and struggling with counting within the current row.
To avoid running a query each time a new row is added, as this seems to conflict with the previous row's selections, I've loaded the data on form load (~680 records) and then use some drop-downs to build a filter that selects from the secondary datasource and works reliably from row to row.
I am able to count the first row correctly, however when I add a row, the count stops working and it becomes additive based on # of rows. (row A has 2 entries, row B has 1 entry, count becomes 3 on both)
I tried using current(), however, I can't seem to get it to work in-place of getDOM() on the secondary data-source.
Essentially, I'm trying to do an error check so that the count of rows = number of filtered entries.
If anyone has any suggestions on how to make this work or a better way to run this check, I'd greatly appreciate it.
Code is as follow:
count(xdXDocument:GetDOM("BookStoreInventory")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:ISBN[../d:year = xdXDocument:get-DOM()/my:myFields/my:Year and ../d:term = xdXDocument:get-DOM()/my:myFields/my:Term and
../d:EventID = xdXDocument:get-DOM()/my:myFields/my:ClassForm/my:ClassGroup/my:Class/my:TempFilter])