4 Replies Latest reply on Mar 26, 2013 10:36 AM by NancyNewburger

    Maintain Sort Order between different layouts

    NancyNewburger

      Title

      Maintain Sort Order between different layouts

      Post

           Hello,

           This is regarding FileMaker Pro 12.

           I am new to FileMaker, switched over from Access. My level of expertise with databases is novice, so anyone who kindly provides an answer to the following, please give step by step simple instructions.

           I have two layouts that I utilize in table view.  Layout #1 sorted in ID (# field)  ascending order.  Layout #2 sorted by Last Name (text field).  

           After creating the sort in Layout #1, I then created the sort in Layout #2.  When I returned to Layout #1 the ID field sort was gone and it was sorted exactly as Layout #2.  

           I am not running any scripts, that I know of.  Is there something going on behind the scenes that could be causing this? And how would I check for that.

           Thanks in advance for any assistance.

        • 1. Re: Maintain Sort Order between different layouts
          DavidJondreau

               Filemaker keeps the sort order (and found set) when switching between layouts based on the same Table Occurence and within the same window. If the sort order for each layout is static (you always want Layout #1 and #2 to sort a certain way), then you can use an onLayoutLoad script trigger to maintain the sort order. If it's dynamic, you could use separate windows or create an additional table occurence from the table and based the layout on that.

               There are fancier (ie more complicated) ways, but they're not worth going into unless you really really need them.

          • 2. Re: Maintain Sort Order between different layouts
            NancyNewburger

                 Thank you for your answer David, but I don't understand this problem.  I have attempted another way of solving the problem but that is not working either.

                 Background:  Layout #1 is a set of records imported into FMP 12 from an excel spreadsheet.  Therefore, the order of the records is creation order.  The ID # field is 1 thru 1232.  

                 I created a Report that sorted those records by last name, first name, and some other fields.  When I switched back to Layout #1 the records had been sorted the same as the Report.  I chose the sort option and unsorted them and they returned to creation order.  

                 Went back to the Report which was in its requested sort order (i.e. last name, first name, etc).  So far so good.  Then went back to Layout #1 and again the records had been changed to the same sort order as the Report.

                 My questions are these, why would FMP change the record order of the table?  What is prompting this behavior?

                 I thought perhaps I would explain, my goals here.  I am trying to create a database for my book library.  This would include a table of the books where each record is in its creation order imported from excel.  

                 I need a layout to input each new record, automatically number the new record and will update that table and any reports I would create.  The reports would be list of books sorted by author, list of book sorted by type, etc.

                 Thanks for any assistance.

                  

                  

            • 3. Re: Maintain Sort Order between different layouts
              philmodjunk

                   You are changing the sort order of a found set, not the table. If both layouts share the same found set, changes to the found set on one layout will also affect what you see on the other.

                   Here's a tutorial on Table Occurrences that may help. In one part of the tutorial, you get two layouts showing the same records, but with independent sort orders: Tutorial: What are Table Occurrences?

              • 4. Re: Maintain Sort Order between different layouts
                NancyNewburger

                     Thank you Phil, I will try that.