3 Replies Latest reply on Feb 15, 2011 10:04 AM by philmodjunk

    Script Sort Problem

    mikedorn

      Title

      Script Sort Problem

      Post

      I have a table (Concessions) used for scheduling volunteers. Two reports use the table to show the schedule and another to show the total hours of each volunteer. Two separate button activated scripts drive each of these reports. The first time a button is clicked from the "Home Screen" all displays correctly for the chosen report. Returning to the "Home Screen" and clicking on the other script button results in a sorting issue, the last button sort order is used and not the expected sort order for the script chosen.

      What needs to be done to rectify this problem (this happens on both platforms mac and pc)

      Help!

      Michael 

        • 1. Re: Script Sort Problem
          philmodjunk

          I'm assuming that you aren't attempting to sort the records as listed in a portal here. That can't be done with a Sort, script step.

          I sounds like the second button's script is failing to sort the records for some reason. I'd check the sort step in that script and make sure that it refers to the correct field(s) from the correct table occurrence(s).

          • 2. Re: Script Sort Problem
            philmodjunk

            Go To Layout is a key step in FileMaker scripts. It establishes a "table Occurrence context" for your script. Each layout refers to a table occurrence box on your relationship graph in Layout setup... (Show Records From). For a given window, each Table Occurrence on your graph maintains a sort order, a found set and a current record. Thus changing layouts may change your context to refer to a completely different set of records.

            Go To Layout will also trip several of the Layout based script triggers such as OnRecordLoad and OnLayoutEnter--which can cause an entirely new script to kick in in the middle of the first script's execution--so that's something you have to look out for if you've defined any such triggers for that layout.

            • 3. Re: Script Sort Problem
              philmodjunk

              If you do a web search you'll find a number of online resources for scripts, calculations and custom functions.

              If you go to a book selling site such as Amazon, you can find several books on FileMaker listed. I can't recommend a specific title as the best fit depends on your current training and experience and I haven't read them all myself, but you can read reader reviews on each such title to select the title most appropriate for you.

              There are also training videos available--including some that are on YouTube.