2 Replies Latest reply on Aug 25, 2009 12:57 PM by trialuser1111

    Limit find results by count

    trialuser1111

      Title

      Limit find results by count

      Post

      I have searched the forums for a solution and found similar topics but no working solutions.  I would like to generate a "Top X" list for several different reports, all sorted by modification date, so I can see which information has been updated most recently.  When I open the layout, I would like to see the 50 most recent updates for a particular table (in descending order), and I would like to be looking at the top of the list.

       

      Currently, I've got a script set OnLayoutLoad, which follows:

      Show All Records

      Sort Records [Descending, Modification Date]

      Go to Record/Request/Page [Last]

      Omit Multiple Records [Get ( FoundCount - 50 )]

      Go to Record/Request/Page [First]

       

      This does not seem to work, and when I run this version of the script:

      Show All Records

      Sort Records [Descending, Modification Date]

      Omit Multiple Records [Get ( FoundCount - 50 )]

      Go to Record/Request/Page [First]

       

      I end up with the BOTTOM 50 records in descending order.  Where is the error in my script?

       

        • 1. Re: Limit find results by count
          philmodjunk
            

          Try this approach:

           

          Show All Records

          Sort Records [Descending, Modification Date]

          Go to Record/Request/Page [First]

          Omit Multiple Records [ no dialog; 50 ]

          Show Omitted Only

          Sort Records [Descending, Modification Date]

           

           

          Using your original script, you could

          Show All Records

          Sort Records [Descending, Modification Date]

          Go to Record/Request/Page [51]

          Omit Multiple Records [ no dialog; get (foundcount) - 50 ]

           

          Omit Multiple Records omits from the current record down, which is one reason why your original script didn't work.

           

          • 2. Re: Limit find results by count
            trialuser1111
               Perfect, thank you!  I just had to add the Go to Record/Request/Page [First] step again at the end, but this is exactly what I was looking to do.