how to set a filter for current row - InfoPath Dev
in

InfoPath Dev

how to set a filter for current row

Last post 04-21-2007 10:56 PM by Shiva. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 04-19-2007 01:16 PM

    how to set a filter for current row

    Hi Everyone,

    I have a master detail and one of the columns in the master is a button to switch to a view. This view contains some detail information however when i switch the view it shows all the details for every record, i want it to just show details from the record i pushed the button on. I think i have to use a filter here but i don't know what to set the filter to. Here is an example of what the schema looks like.

    Thanks,

    Erin
     

     



     

  • 04-20-2007 06:42 AM In reply to

    • ahardin
    • Top 200 Contributor
    • Joined on 02-13-2006
    • United Kingdom
    • Posts 55

    Re: how to set a filter for current row

    Hi

     If you have a Unique Identifier in the master section of the main view then that can be your what you base your filter on.  On the detail page I presume the detail is held in a repeating section/table and it is this that is repeating, showing everything.  What you need to do is go into the properties of the repeating section/table and it will give you an option to "Filter" on the 'Display' tab.  Here you want to set the filter such that the master information on the detail page is equal to master information on the main page.

     I hope this helps

    Adam

    I'm from WALES
    [email protected]
  • 04-20-2007 06:47 AM In reply to

    Re: how to set a filter for current row

    Hi Adam,

    Thanks for your response. I have set up a filter and i believe it's set up as you describe but it's still showing ALL the rows not just the ones i want to see. In my master I have a field called ID and in the details i have a field called MasterID and in the filter on the detail view i say where id = masterid. I don' t have the master and detail linked as master and detail though.. is this the problem? I can't figure out how to do that as the master is already a master for another detail view.... does this make sense?

    Erin

  • 04-20-2007 07:12 AM In reply to

    • ahardin
    • Top 200 Contributor
    • Joined on 02-13-2006
    • United Kingdom
    • Posts 55

    Re: how to set a filter for current row

    OK

    you could try in the filter doing the following, changing the left hand side to be where Master ID = ID, then, once that is set, click on the left hand side drop-down box and select "The current expression".

     Then adjust the line AFTER the equals sign to = current()/@ID

     If that does not work then your primary data source is more complicated so you have to add in the Group in the form = current()/group/@ID or similar

     I hope this helps.

    Adam

    I'm from WALES
    [email protected]
  • 04-20-2007 08:01 AM In reply to

    Re: how to set a filter for current row

    Ok I tried that but i could not get it to work... i tried many different combinations (with adding in the groups and such to the xpath) but then i couldn't get ANYTHING to show... man...

    I found a work around where i have a temporary field and i put the value of the masterid in this field before i switch the view and then i have a filter that compares the masterid and the temp field.. not the best way or the right way to do it but it works.

    Thanks,
    Erin

  • 04-21-2007 10:56 PM In reply to

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

    Re: how to set a filter for current row

    Hi Erin,

     

    Anyway you found the work around to solve your problem.

    You can try one more time which you have done the filter Xpath with the prefix namespace of your nodes. In every xpath of filter you didn’t mentioned about the prefix of node. Filter will work whenever our xpath is correct otherwise it displays nothing.

     

    You can try the below filter once and could you try more xpath’s of related this one.

     

    id = current()/d:group/MasterID

    Or

    id = current()/d:group/d:MasterID

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