FileMaker Pro Advanced / Custom Menus Scripted pt. 2
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
So let's go back to our Navigation, though. That's a little simple. The Records Menu is where we get really sophisticated. So let's edit the Navigation Menu. Now this is completely created from scratch and we made a Menu Name with no existing commands and added all of our own ones. We came in and we added one for Invoices, and this is just basic navigation. Go to the Layout Invoices, go to the Layout Customers, and go to the Layout Products, and I added Keyboard Commands, Command 3, Command 2, and Command 1, just for easy navigation, so if somebody doesn't want to use that button menu that we put up in the upper right-hand corner, which is a couple of clicks Ð you have to choose a menu choice and then click the button Ð well, you could just hit the Keyboard Commands now, or you can even just go to the Menu, which is even less than the Menu Button. So, it's just a handy way to have Navigation. So let's go over to our Records and let's see what we've got here. It's up here. There's Records; we'll edit that, and let's see where the magic happens. The first magic happens here. We overwrite the Title and we use that old trick. We say Left Words Get Layout Name Get the First Character, or the First Word. So if we have a good layout naming convention, in other words, each one of our layouts starts off with Invoices, or Customers, or Products, then this is going to work great and then we're going to put into Proper and so, each time we change layouts this is going to change, and so right now we're on an Invoice Layout, but if we were on a Customer Invoice it would say New Customer. So we're using one menu for multiple tables. Pretty cool. And then also what we've done here is we have our Title is dynamic. It's basically the same idea as what we had up before, Get the Left Words, but then we have to put it into singular, remember, it's Invoices, but we want New Invoice, not New Invoices. So we have to say take the length of our Left Words Get Layout Name minus 1, and then take that whole thing and say, Left of that, and that takes off the character, and we've gone over this, so I'm not spending a lot of time on it, but basically it takes off the S off of Invoices, the S off of Customers, and the S off of Products for us so that, and you can see what it's doing in here, it's saying New Invoice Duplicate Invoice, and so on. And then I just have it run our scripts. You can see how the scripts are there: Duplicate Record Ð we've written all these scripts already Ð so we'll Cancel out of that, and that's basically it. Now you may get more complicated. You may have a Reports Menu and things like that, but I wanted to show you the basics of creating a dynamic Menu Set here. So we've got one Menu Set for every single table. As long as you have good naming conventions this will work perfectly. And so, there's another piece to this whole puzzle. The other piece is we have to go into our Script and we have to go to our open Script, and we have to look at it. We have this new piece of code in here, and we've used this. We've already done Get Privileged Set Name equals Full Access. That means if you, the developer, logs on, install the Menu Set, standard FileMaker Menus, and set that as the Default, otherwise everybody else we're going to set to the User and put that as the Default. That's why setting your Layout Setup in Layout Mode to the Default is better because then you can control this all through scripts. In fact, you could get a very complicated If Else If if you had, you know, multiple menu sets that you wanted to install. But I try to keep it simple if I can. If I can use one menu set through the whole thing that's even the best solution, so you have a real simple script here. So we're going to Close that and in order to test this, you notice that we have the Default is your standard FileMaker Menus, when we test this we're going to have to Close this, Open it up, we'll type in User1 1234, click OK, and you can see how now we've got our Customer's Menu and if we switch over to Invoices we've got our Invoices Menu. So this works great. If you try to make things dynamic it may take more work to learn how to do it, but eventually once you learn it it's going to make your job a lot easier because you can make a lot less Custom Menus, a lot less Scripts, a lot less of everything.
Tutorial Information
| Course: | FileMaker Pro 10: Intermediate |
| Author: | John Mark Osborne |
| SKU: | 33926 |
| ISBN: | 1-935320-19-X |
| Release Date: | 2009-01-05 |
| Duration: | 15 hrs / 177 lessons |
| Work Files: |
Yes |
| Captions: | Available on CD and Online University |
| 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 