FileMaker Pro Advanced / Custom Menus Scripted
Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.
Learn More
Subtitles of the Movie
With the approach to custom menus outlined in the previous section, we would need, at the very least, one menu set for each table, if not more. What I like to do is create a system that allows you to create as few menu sets as possible, even possibly just one. So we're going to show you how to do that. In fact, let's show you something that's really annoying about how when you assign a default layout to layout setup, as we have here. In fact, let's turn back on standard FileMaker menus, go into layout mode and remind ourselves that in layout setup, we have it set to users. Well, you can see every time we go from one layout to another, it comes back to that and then you go, as a developer, go ok, well, I need standard FileMaker. It can be a little annoying for the development process. So I generally don't like that. I want to stick with the default because then I can completely control it through scripting. So we'll go into layout setup, go to remove users. It used to be called invoice, but we changed it to users and we've also changed what it does. So we'll go back to file default, go back to browse mode and now what we're going to do is go into our manage custom menus and here again, users is what used to be called invoices. And remember this default here. This is what the default is right now because we haven't set it to anything other than standard FileMaker menus, but we'll show you how to do that. So we'll edit this users and we'll see that we have four choices. We'll start with invoices, which you can't edit them here. You have to come down to this section. We'll edit the invoices. It's real simple. It simply has a name for that menu item that shows up there and then simply runs a script step, which does a show custom dialog which says this is created by me. And if we come down to help, we'll see if we edit that one, it's not much more complicated, although it does ask for something else. It asks for you to include a script here that might take you to a layout and might have some features in there for locating help specific to your solution rather than FileMaker. But since we haven't gone into help scripts and things like that yet, we just put a holding spot here with a show custom dialog that says you should put a script here. But these aren't very important, the, the invoice and the help. I just had to have them. What's really important is navigation. And even more important, records. So let's look at navigation first since it's not quite as complicated. So navigation menu allows you to switch from invoices to customers to products. Well, all we did was said go to layout when you choose that. On this one, we said go to layout customers form. Go to layout products form. And each of them has a keyboard command as well. It's real easy to set these. You just open it up, hit the keyboard commands you want and then click OK and it remembers it. So that's not very complicated. The real interesting one is when we get into the records one. Here's where you can really make a dynamic menu. So we'll see under here, under the title, here's where we've used that same technique of get layout table name, then we want just the left words of that, because remember, it might be a table occurrence invoices underscore form. We only want invoices. And then we change that to proper. So what's this going to be called? Well, if we're on an invoice layout, our title of our menu's going to say invoice. If it's in customers it's going to say customers and so on. That's the dynamic nature. This is how we get instead of a lot of menu sets, one menu set. And then when you go down to your menu items, we repeat the same idea. Here in the title we had that same idea. Now, it's a little bit longer because remember, we don't want the plural, we want the singular. And we've gone over this before so we won't do it again. It's essentially the same thing. It's left words, left, length of the left words and so we're essentially removing the S off the end of the table and then concatenate it with create new. So you'll see that each one of these is the same, exact same formula at the end, but the difference is this part at the beginning and same for delete invoice. Exactly the same thing. The difference is, depending on which table you're in, and we happen to be on an invoice table right now, you can't see it but we're on that, that's why it says invoice right here, but if we had opened up custom menus on a customer table, it'd say customers there. In fact, when we actually implement this, you'll see it'll work great. So we'll cancel out of that, cancel out of that. Remember, our default menu is standard FileMaker menus. How do we change that? Because again, we want to make sure that layout setup picks up the file default. So we can do that in Script Maker in our open script. So we test for the privilege set name, does it equal full access? If it does, we install the menu set standard FileMaker menus and very importantly, use as default; otherwise it must be a user and we could have several levels of users, but here's just one. We'll specify this custom menu, use as default. So if we go into browse mode and we close this file and open it up again, and we'll use user one and a password of 1234, we'll see that now we get this nifty navigation menu and this invoice menu that is specific to that particular table. So if we switch to customers, now it says customers, viola. So this is much more efficient. You don't have to maintain nearly as many menu sets. Try to make it as dynamic as possible.
Tutorial Information
| Course: | FileMaker Pro 9: Intermediate |
| Author: | John Mark Osborne |
| SKU: | 33823 |
| ISBN: | 1-934743-30-5 |
| Release Date: | 2007-11-13 |
| Duration: | 10.5 hrs / 130 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
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 