Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Limit record count in Found Set

Featured Replies

I'm needing away to limit the the Number of records for a found set.

In this example I have a single table. with three fields.. PONumber, OrderNumber and OrderDate.

I want to create a script to find the 10 Oldest "PONumber" by "OrderDate with an empty "OrderNumber"

Any help is greatly appreciated.

Thanks

26 minutes ago, Devin said:

I want to create a script to find the 10 Oldest "PONumber" by "OrderDate with an empty "OrderNumber"

 

Hi Devin,

There might be better ways of handling it rather than performing a find.  But if you simply wish for a find to achieve what you indicate, you might try this (untested):

Set Error Capture [ On ]
Perform Find [ order number: “=” ; Restore ]
Sort Records [ orderDate ; ascending ]
Go to Record/Request [ 11 ] [ No dialog ]
Set Error Capture [ On ]
Omit Multiple Records [ Get ( FoundCount ) - 10 ] [ No dialog ]

 

Edited by LaRetta
changed descending to ascending

  • Author

This looks like it works based on a few test.. Never used the Omit  Multiple Records like that.. Very cool.

Quick question.. why are you turning on Error Capture twice? I thought you only needed once per script.

Thanks.

3 hours ago, LaRetta said:

Omit Multiple Records [ Get ( FoundCount ) - 10 ] [ No dialog ]

Oh, that's nice.... I've always just used a very very big number...

13 hours ago, Devin said:

Quick question.. why are you turning on Error Capture twice? I thought you only needed once per script.

I simply got side-tracked, Devin.  I started to add additional steps of if/else on the error trapping, saw I wanted to change the sort order, and then got pulled away on something else.  :pounce:

Setting error capture on once is usually enough but there are exceptions where one might turn error capture back off then later turn it back on again.  

11 hours ago, webko said:

Omit Multiple Records [ Get ( FoundCount ) - 10 ] [ No dialog ]

Oh, that's nice.... I've always just used a very very big number...

I know what you mean!  I've concluded that, no matter how large a number I guess, some day years later that table might surpass that record count and then the script would fail.  It seems that, no matter how well we humans try to predict where we'll be in future with anything, we greatly underestimate.  Exact is reassuring. :smile3:

BTW, this was picked up from Comment more assuredly although Ray Cologon used it as well.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.