I know I'm missing something simple but???? - InfoPath Dev
in

InfoPath Dev

I know I'm missing something simple but????

Last post 06-16-2009 11:00 AM by kennebg. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 06-15-2009 01:30 PM

    I know I'm missing something simple but????

     

    I have been fighting with this for days now.  I have looked at hundreds of posts on InfoPathDev and other sites and I cannot seem to find exactly what I am looking for or if I do it doesn't work.

     Any help you be greatly appreciated!!!!

    I am using InfoPath 2003.  I have a repeating table in which I need to filter and/or remove duplicates based on the first field of the table only.  I have tried all kinds of variation on Count to determine if the value already exists in the table and then to either not insert it again or to filter it from view.  Either one would work.  I've tried the various sibling settings as well and the rule or condition is just never true or is always true.

     I've also tried comparing an input field from outside the repeating table to count the number of occurrences of that items and if it is greater than 1 then I don't insert the new record. 

    If I set a simple field to display the number of occurrences then it works fine.   Ex:  count(../my:group1/my:Heats/my:field4[. = "6181"])  If it try to replace "6181" with a variable so that I can count based on the input field then I get nothing. I think that it may be I am not understanding the usage of the node levels in various parts of the form. 

    I would explain in more detail but I tried and it gets very long.

    If someone has any idea what I am doing wrong.  At its simplest I need to just filter duplicate items from display in this repeating table.

    I am weeks into this project and I have been able to work out all my other problems but this one will just not go away and it is a must that I only show the item once in this repeating table.

     

    Thanks so much for your time!!

    Bob

  • 06-15-2009 01:53 PM In reply to

    Re: I know I'm missing something simple but????

    What is the data source for populating the repeating table?

  • 06-15-2009 02:11 PM In reply to

    Re: I know I'm missing something simple but????

    Thanks for answering.

     It is a Sharepoint standard list.  I set the first field value to the key of the list and then a rule on it sets the remaining fields in the repeating table to their values based on the filtered Secondary data source.

    The repeating table is bound to the main where it lives.  It is not bound to the secondary.  I just use the secondary to popluate it.

     Thanks!!!!!!!!!

  • 06-15-2009 02:24 PM In reply to

    Re: I know I'm missing something simple but????

    Why (how) does the list have duplicate values for the primary key?

  • 06-15-2009 05:49 PM In reply to

    Re: I know I'm missing something simple but????

    The Sharepoint list does not but let me see if I can explain it breifly and it make sense????

    There are two Main data sources that are both Sharepoint XML Form documents libraries and a couple of support lists including this list I'm using as a secondary data source in this form.

    This system collects test results at various stages of manufacturing and the first Main data source slowly gets built as the testing progresses.  These tests are of components that eventually may be combined to produce a finished product. Part of the test results that are captured include chemistry's of a batch of raw material.  This raw material will ultimately be used to produce any number of half-products as we call them.  Each of these half-products is tested and the results recorded and the chemistry is included from the raw material level so there may be 20 records in this form library that may all be different except for the field that identifies this chemistry will all be the same for all 20 records because it came from the same raw material. 

    Then 5 to 7 of these half-products will be blended together to make a single finished product.  I have to produce a printed certificate that is sent along with the finished product showing all the tests that were done on the half-products and the finished product.  There is a linkage that is created during production that ties the 5 to 7 half-products to a new finished product test which includes all the test data from all half-products and the chemistry numbers from each product.

    When it's time to produce the certificate they would enter the new finished product test ID and that pulls in the test results from the 5 to 7 components.  Some of these could have the same chemistry number. some might not.  frequently all the components come from one raw material batch so they all have the same chemistry but sometimes it will span two batches and it could span 7 batches.

    They do not want to repeat this chemistry information for each component product.  It is just summerized on the form elsewhere. So this repeating table would normally probably only contain one row and possible two but it could contain 7.

    As I load the component test results I take the chemistry number from the component test and then use it as the filter to load the repeating table from the secondary data source. At this point if the row with that chemistry number is already in the repeating table I would like to either not insert it again or filter it from view.  It really doesn't matter as long as it is not seen more than once.

     Told you it wouldn't be short!

     Anyway that's what I need to do.  I can find my way around JavaScript if needed and have some pieces I'm using for simple things already but i'm not doing in C# in this at all as I barely know C#.  So rules or JS is what I'm looking for.

     Had we known this was going to get this invovled I would have just done it in VB with a SQL backend but almost done with at this point with everything else working as desired.  It is a temporary solution so we were tying to avoid writing a entire system from scratch for use of less than a year.

     Thanks for your help!!  And yes, I know you're sorry you asked now!!!!

  • 06-15-2009 06:32 PM In reply to

    Re: I know I'm missing something simple but????

    I can't picture it in my head based off that explanation, so I'll just have to think about it and see if anything comes to me.

  • 06-16-2009 11:00 AM In reply to

    Re: I know I'm missing something simple but????

    Thanks for your help on this.  I was able to finally get a Count rule to work as needed so I just avoid inserting the line in the repeating table again if it already exists.

     

    It is working as I need it to at this point.

     

    Thanks again for looking at it though!!

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