Username:
Password:
FileMaker Pro 9: Advanced Tutorials

Ultimate Find / No Records Found

Subtitles of the Movie

One of the reasons you add scripts to a FileMaker solution is to make it user friendly. And here's a great example. If we hit the Find button and type in something it can't locate it gives you this message from FileMaker. It says, No records match the set of find requests. Then there's a cancel or continue, and a modify or find. There are many different levels of problems with this message. First of all, what's a record? I'm looking at customers. What's a request. I don't know what that is. Do I hit the Cancel button, the Continue button, or the Modify button? And it's important to note here that this Cancel will not be here if Allow User Abort is off. You'll just have to continue to modify Find. So, you know as a developer, what all these choices do and this means, but your users don't necessarily know what this means. So, let's try hitting Continue and see what happens. Well, what it does is it continues on with the rest of the script and shows you your Found set with zero records. So that's not a good thing. You don't want to leave your user with that, so we want to try to get around this problem and we worked with Set Error Capture before and it's the way to handle this, but we're going to go more in depth into how it works. Let's go to ScriptMaker and we're going to come down to our Ultimate Find and we could add a Set Error Capture On, but we're going to modularize it as well so we'll make a new script called Set Error Capture, and I could do the same thing as I did with Allow User Abort and have it off if it's the Admin, or on if it's everybody else, but typically with this one, I like to turn it off and on a lot. It's up to you. Maybe you like it that way, but I'm just going to put it in here so I can manipulate it easily whenever I want to. So we're going to have it On for right now and the nice thing is now it's modularized. Now I can turn it on and off anytime I want for all the scripts, so you will want to add this to all your scripts. So we'll come in here, duplicate this, ad then we'll do Set Error Capture. So, let's try it just with this script in here. Hit Save, hit Find, type in something it can't locate, click Continue, and you can see what it does, it takes away the Error messages, but really what it does is it clicks the Continue button on that error message and does it so quickly the user can't see it because you're again here with zero records and it ran through the entire script. So what we need to do now is figure out where the error occurs and what that error is. Now, we've already worked with the 401 error, which is No Records Found. So that's easy. We can add that in there. So we go into ScriptMaker and we'll go under Ultimate find, and here's where the error occurs; we'll put a new statement there, and we'll put in: Get last error equals 401. And if that happens we're going to show a custom dialog: No customers found. No customers were located. And here's where I have the chance to really give them a good message; tell them what to do. Click the okay button to go back to data entry mode. So I get a chance to call Browse mode whatever I want to here and we'll fix that little error there, and then we'll come down here and take the Cancel out and then we have one more thing. We don't want to leave them with zero records found. It's really going to confuse them. They might think they deleted everything. So come up here and locate Show All Records; there it is, and it's very important to put it here, rather than right here, because if we do show records before a show is custom-dialogued, we're going to see the fine screen behind us with all records showing, but if we put it here, we're going to see our message on top of Browse mode with no records found. It'll be blank. I think it just makes a little bit more sense to show the records after this so that they don't see anything in the background and go, Well, why don't I understand this. I did find something. So, anyhow, we'll stick with this and we'll hit Save, and we'll try the find again. Type in Johnny, hit continue, you get the nice message, click OKay, back to Data Entry mode and you have all your records showing.

Tutorial Information

Course: FileMaker Pro 9: Advanced
Author: John Mark Osborne
SKU: 33824
ISBN: 1-934743-32-1
Release Date: 2007-11-21
Duration: 10 hrs / 115 lessons
Work Files: Yes
Captions: For Online University members only
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 81,350 Video Tutorials (20,800 free)
  • Video Available as Flash or QuickTime
  • Over 782 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available