1 Reply Latest reply on Sep 24, 2009 11:30 AM by philmodjunk

    Sort problem with FM pro5 V03

    tom.pappas

      Title

      Sort problem with FM pro5 V03

      Post

      I am using File Maker as a test system interface for filling in forms.

       

      There are 4 records 1 for each product and they are sorted.

       

      At some point while entering data , and scripts are run, the record sort becomes unsorted and the record being used still remains on the screen. (i.e. the record number changes from 2 to 3  and 4 changes from 4 to 2, 1 stays 1.

      I can press sort or add a sort to the scripts, however I end up with record one being displayed instead of the record I was working on.  I need the record I'm working on to remain on teh screen.

       

      What do I need to do to keep the records sorted?

       

       

      Also,  I added product 3 and 4 which sort into record number 2 and 3 moving the original record 2 to 4. Is the order reverting back to an as entered order? if so How do I repair this ?

       

      Thanks,

      Tom

        • 1. Re: Sort problem with FM pro5 V03
          philmodjunk
            

          "I can press sort or add a sort to the scripts, however I end up with record one being displayed instead of the record I was working on.  I need the record I'm working on to remain on the screen."

          If each record has an auto-entered serial number, define a global number field, gCurrentRecord.

          Define a relationship linking the current file to itself, with gCurrentRecord on the "left" and your auto-entered serial number field on the right. Name the relationship "CurrentRecord".

          In your script, use set field to save the current records serial number in gCurrentRecord, sort the records as desired and then use Go To Related Records, refer to CurrentRecord as the relationship, but do not specify "Show only related records". This step will now pop you back to the record that was current just before you ran the script to sort the records.

           

          "Also,  I added product 3 and 4 which sort into record number 2 and 3 moving the original record 2 to 4. Is the order reverting back to an as entered order? if so How do I repair this ?"

          If the found set has become "unsorted" (check the status bar on the left), the records are now in the order in which they were created (or imported if they were ever imported from another file.) You'll need to use your script to re-sort your records. If your script doesn't sort them in the order you want, you'll need to modify your script to sort them correctly.

           

          Note to users of more recent copies of FMP: Back in the days of fmp 5, relationships were defined differently and GTRR had much fewer options. It also didn't have the technical "gotchas" that can trip you up in more recent versions. For more on the current incarnation of go to related records, see:

          The Complete Go To Related Record