Filter formula for Current Record - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

Filter formula for Current Record

Last post 02-22-2013 11:39 AM by Metron4. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-25-2013 11:45 AM

    Filter formula for Current Record


     I am trying to write a formula that will filter values for text box controls that match the current Project ID. This example uses the Cost Code associated with the project.

     xdXDocument:GetDOM("Charge Codes")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:CostCode[../d:ProjectID = xdXDocument:GetDOM("Projects")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:ID[../d:ProjectID = xdXDocument:get-DOM()/my:myFields/my:ProjectID]]

    It actually works, but now the preview takes way too long to load, and when I enter a different project ID, it takes a long time to switch the cost code. I assume it is because my formula is too convoluted, but this was the only way I could get it to work.

    Can someone tell me if there is a more efficient formula? Please see attached image. Thanks.


  • 01-25-2013 02:22 PM In reply to

    Re: Filter formula for Current Record

    Hi Metron4,

    I would try breaking it apart into two calculations. Do the inner one in the default value of a field which does not appear in your view. Then, the view element can reference that hidden field to do the top filter. See if that's faster.

    Just an idea,


    Patrick Halstead
    Project Manager at Qdabra
  • 01-28-2013 08:42 AM In reply to

    Re: Filter formula for Current Record

     Thanks for the reply. Do you have an example of this? I have never set up another view before.

  • 02-22-2013 11:39 AM In reply to

    Re: Filter formula for Current Record

     I was able to accomplish what I wanted by creating a hidden control that stored the ID value. My lookup values now call the ID value of the hidden control saving several steps in the formula. The form loads much faster now.

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