Ron Cates Posted October 2, 2009 Posted October 2, 2009 Hi All, I am performing a find in a script with error capture on to display a custom message depending on the results. When no results are found, how can I restore the found set instead of displaying zero results or showing all records? Thanks
bcooney Posted October 2, 2009 Posted October 2, 2009 You could capture the IDs of the existing found set in a global text field. Then, in the If (Get Foundcount) = 0) section of your script, you could gtrr, existing layout from the global field to the record's primary key. BruceR had a neat post recently about capturing a found set of IDs.
Ron Cates Posted October 5, 2009 Author Posted October 5, 2009 Thanks. That was pretty much what I had in mind. I know I could loop through and collect the IDs but is there any onther technique? Looping seems like it might not be seemless enough if it's a large founs set.
bcooney Posted October 5, 2009 Posted October 5, 2009 Here's a link to Bruce's technique that I mentioned above. Link
Fenton Posted October 5, 2009 Posted October 5, 2009 (edited) Bruce's is a great new routine for capturing the IDs of a found set, which could be used to restore a found set (among other things). But there is an easier and faster way to just capture and restore a single found set. http://www.sumware.net/robfm2/?p=4 It is a little weird to wrap your head around at first. It exploits the built-in tie between a table occurrence, a layout and a found set. It gives you some insight into what a table occurrence group means. The operation is pretty much instantaneous, even with large record sets. Its one limitation is that you have to specify which layout to return to, directly within a Go To Related Record step, when you do the "restore found set." But you can switch to another layout afterwards, using a captured name or id. Edited October 5, 2009 by Guest
Ron Cates Posted October 5, 2009 Author Posted October 5, 2009 Great! Thanks so much as always guys. I will let you know how it works out. :(
Fitch Posted October 5, 2009 Posted October 5, 2009 Another option is to do the Find in a new window. If nothing is found you simply close the window. Not only do you retain your found set, you also keep your Sort order. A really cool implementation of this that will save you a ton of time and knock your client's socks off is fmSearchResults.
Recommended Posts
This topic is 5527 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now