3 Replies Latest reply on Aug 11, 2015 9:47 PM by philmodjunk

    Find Record Number by Field Data/sort order.

    KerryMiller

      Title

      Find Record Number by Field Data/sort order.

      Post

      I'm looking to add a conditional Go To Record script that is based on field data.

      For this I have a few things set up:

      A global value of what our current Live "Season" is (a date number calculated by converting an abstract date into a numerical one)

      All Records have a field with the Release Season (similar method, abstract date converted to numerical date)

      I'm looking to find the lowest Record Number for a given season based on the current sort order.

      I know how it would work, but my scripting skills are not the best:

      Sort Records

      Get lowest Record Number whose Release Season field matches Live Season Global Value.

       

       

       

       

        • 1. Re: Find Record Number by Field Data/sort order.
          philmodjunk

          If you are sorting in ascending order, go to record [first] would take you to that record. In descending order, Go to Record [last] will.

          • 2. Re: Find Record Number by Field Data/sort order.
            KerryMiller

            So If I have it look for Get (Field Value) [First] it will select what I want?

            EG:

            I'm looking to select the first Record in the Beta Group for the given sort:

            List of things:

            George - Alpha

            Greg - Alpha

            Harry - Alpha

            Greg - Beta

            Kim - Beta

            Larkin - Delta

            Jim - Delta

            The script will select Greg:

            List of things:

            George - Alpha

            Greg - Alpha

            Harry - Alpha

            Greg - Beta <--Select this Record

            Kim - Beta

            Larkin - Delta

            Jim - Delta

            • 3. Re: Find Record Number by Field Data/sort order.
              philmodjunk

              I recommended Go to Record/Request/Page [First]

              Once the focus is on that record, you can access the value of any field in that record by name.

              Similar things can be managed via a sorted relationship to access the related record with the smallest or largest value.

              I'm looking to select the first Record in the Beta Group for the given sort:

              Any reason why you can't perform a find for that Beta group and then sort just it? Likewise a relationship or ExecuteSQL query can specify or link to only the Beta group. And you can perform the find in a second hidden window or in a different layout (based on a different occurrence of the same table) if you want to keep the current found set intact while working with sub groups of the same.

              You can also set a script to start with the first record and then it can loop through the records until it reaches the first record in the Beta group.