Ultimate Find / List Versus Form
Subtitles of the Movie
There is a little problem I'd like to fix and that happens when you run the Find script from the customer's invoices layout. If we hit Find and type in J-o-h-n and hit Continue, we see that we have one of 47, and you might think it's a problem with that, but actually our Status area shows the same thing, but if we go over to Customers and we see we have three records found; Notes, same thing; Lists, same thing; it's just that our Invoices layout that's showing all our invoices for this customer shows 47 records, and why is that? Well, the answer is found in Layout mode, and if we go to Set Layout, Order, we can see that all these layouts are based on the same table occurrence whereas this one's based on a different one. And this is an interesting concept about FileMaker that you really want to understand. So, in other words, if I do a Find inside of this layout, it's finding on that table occurrence; the same records as all these other layouts, but it's still only associating that Find with any table occurrence that is attached to any other layout that's the same. So, Customers and Customers Invoices are two different table occurrences; they have independent finds. So, we will actually use this to our benefit in the next section, but right now we need to get around this. And, actually we'll solve another problem also at the same time, or really add a feature in here. So, let's go into ScriptMaker and we're going to our Ultimate find, and what we want to do is say, Else-If get found count equals one; if that's true, perform a script, and we're going to perform our Form view because we found one record. Duplicate that; move it down there; otherwise, perform our List view, and then we'll duplicate this and put it up there. So, now what's happening is, if we have one record found, show the form view; if we have more than one record, in other words, this is not true, this is not true, and this is not true, we must have found more than one record, Show List View, and then exit the loop. So, we've solved one problem and made actually a feature. Now it always goes to our former list view, which I think is better in the case of that invoice's filter anyhow. It really didn't make sense to return results in that layout. Now. We also need to fix this. We don't want to, after we go to List view, for it to go to the original layout, so we need to move this up into this area and then move this back up in here. So we have two Go to Layout, Original Layouts; we're duplicating it, but it's for a good cause because we need to make sure in this case that we go back to the original layout and this works perfectly here, and this seems like it might work, but it really doesn't work. That's because each time they decide to hit Yes, it's going to go back to the original layout. In this case, it's only going to happen once. They're going to get an Error 400 and it's automatically going to go to the original layout and then exit the loop. This could loop; this second choice could loop and loop and loop and we don't want it to be on the original layout. It'll cause a bunch of problems. So. We're going to put an If Statement in here, and we're going to take the same exact message. I'm going to copy it to the clipboard. And then I'll paste it with the keyboard command in there, and then we'll change this to a one. So, now if the last message choice is two, and they hit no here, then we're going to go to the original layout and exit the loop, otherwise, if they hit yes, we're going to skip those and so it'll never go to the original layout until we want it to. So. Let's test this out. We'll hit save. Close that. Hit Find. We'll type in something that finds multiple records. Good. There we go. It's perfect. And then we'll go back here, try hitting Find again, and I'll type in something; it only finds one record, and it goes to Form View. So that works perfectly, and just what we want. So, by fixing a problem we've also actually made a feature in here. Because I think it's better to show multiple records in List view anyhow, rather than in Form View.
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
United States 