March 2, 20169 yr 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
March 2, 20169 yr 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 March 2, 20169 yr by LaRetta changed descending to ascending
March 2, 20169 yr 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.
March 2, 20169 yr 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...
March 3, 20169 yr 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. 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. BTW, this was picked up from Comment more assuredly although Ray Cologon used it as well.
Create an account or sign in to comment