3 Replies Latest reply on Aug 2, 2012 6:32 AM by philmodjunk

    Records disappear when sorted, reappear when unsorted



      Records disappear when sorted, reappear when unsorted


      (Strangest thing I've seen in 20 years of dealing with FMP)

      1. I have a table called "task_tbl".  The records are generated by a script in batches of 1-200 or more by importing from a task_library table.

      2. When they are first created, they appear quite normally in a list on a task_tbl layout.

      3. I then open a new window on top of the first window and display a subset of records from the same task_tbl.  The records in the new window are sorted in a different way than the records from the same table on the first window.

      4. What's happening is that the first time I try this with newly created records, as soon as I sort the subset in the new window, both task_tbl layouts are suddenly apparently empty! The fact is that there are actually records there, they just aren't being displayed. You can see in the status bar the system is indicating "20/363" records but no records are visible. (Note the partially displayed fields at the right of the screenshot)

      5. Here's the kicker...If I then UNSORT the records, they will reappear.  Unsorted of course.  As soon as I sort the reords...they disappear again. Eventually if I edit a record that was previously displayed, it seems to correct everything although on several occasions this has been followed by a complete FM crash which has sometimes required a Recover.

      After a crash or sometimes if I navigate away and come back, those same records will behave perfectly normally!


      Weird, weird, weird.

      So, in summary:

      1. I'm displaying multiple, different found sets from the same table in different windows. Problem?

      2. I'm also sorting those multiple sets in different ways in the different windows.  Could this be creating a problem?

      This is happening in other scripts where I open a subset of records from the same table in a different window and loop on them or otherwise modify them. But it seems to me I've done that kind of thing before and never had a problem?

      Looking forward to any help.




        • 1. Re: Records disappear when sorted, reappear when unsorted

          The crash suggests that your file is damaged. If not before the issue, then the crash itself might damage the file.

          I recommend that you run a recover on this file and see what is reported. Since recovering rebuilds indexes and makes other changes, test the recovered copy even if recover does not report finding any problems.

          Things to keep in mind about Recover:

          While Recover almost always detects and fully corrects any problems with your file...

          1. The recovered copy may behave differently even if recover reports "no problems found".
          2. Recover does not detect all problems
          3. Recover doesn't always fix all problems correctly
          4. Best Practice is to never put a recovered copy back into regular use or development. Instead, replace the damaged file with an undamaged back up copy if this is at all possible. You may have to save a clone of the back up copy and import all data from your recovered copy to get a working copy with the most up to date information possible.
          • 2. Re: Records disappear when sorted, reappear when unsorted

            Yes, have recovered several times, no problems reported.

            I also saved one of the recovers as a Clone (no Records), exported all the reference data from the damaged file out to Excel, then re-imported it into the new empty Clone.  So there were absolutely no Filemaker records directly from the damaged file in the one I'm working with now.  But of course the one I'm working now is in some way connected back and may still have some damage from many versions ago that Recover has simply not detected.  


            If that is the case, and I have a fundamentally damaged file - is there any other recourse available?

            • 3. Re: Records disappear when sorted, reappear when unsorted

              I'd first try these tests to rule out other issues:

              If you are using a script to sort your records. Try doing these steps manually to make sure that it's not an issue with your script.

              Create a small test database from scratch, import your data and perform the same tests to make sure it isn't an issue imported with your data.

              There's also a third party produced utility for examing a file for damage: FMDiff. You may want to acquire that utility and run it on your file to see what it reports. It may spot issues that recover misses.