5 Replies Latest reply on Jan 24, 2013 7:09 AM by philmodjunk

    Keep database sorted by one field



      Keep database sorted by one field


           I have a database of accounts that I run on a vending route. I need to keep them in order that I service the machines. I have done this by using a "STOP" field, and number them in the order they should be serviced.   

           My problem..    everytime I view the database they are all out of order. I have used the "sort assending" over and over I have also defined the field to Keep field STOP sorted in assending order. when I open it up again it is again unsorted.




        • 1. Re: Keep database sorted by one field

               Are you working with a database hosted from FileMaker Pro or FileMaker Server on a different computer?

               If you sort your records on the host computer (or the only computer if it is a single user set up), the sorted order and other found set details should be retained and you should see it again when you re-open the file unless some trigger controlled script intervenes. If you are accessing this as the client of a hosted database, however, the foundset--including the sort order, is not retained when you close the file.

               You can make sure that the data is correctly sorted each time you access the layout if you use an OnLayoutEnter script trigger to perform a script to sort your records each time that you access this specific layout.

          • 2. Re: Keep database sorted by one field

                 For now I am using FileMaker Pro 12 single user as admin on a file on the local pc.  Have not gone live with it yet. Trying to get the bugs worked out. I will give the above a try to see if it solves the problem. Thanks!


            • 3. Re: Keep database sorted by one field

                   Tried the script out.  It helped a little. I seem to have the problem in find records mode.. That's one time they need to be sorted. 

              • 4. Re: Keep database sorted by one field
                 Would users always do a find as soon as they open your solution? if so you need to set up a script to do the find then do a sort based on your criteria
                • 5. Re: Keep database sorted by one field

                       Finds always produce an unsorted found set so this will remove the sort order.

                       But if you select the OnModeChange script trigger in Layout Setup and select the "exit find mode" option, you can also set that script to sort your records. Then any find that you perform on this layout will always be sorted once the find has been performed.