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.
It's possible to include records and windows and files in your Back Button if you want. Right now we're just tracking layouts, which is really the most important thing to track with a Back Button. In general, I don't track records, windows and fields if I create a Back Feature for a client. But I want to demonstrate it anyhow so you can see how it is done. Now, why don't I do this? Well, the basic reason is most people need to track records, windows and files but there's some issues as well. For instance, let's say you have a found set and that found set changes and then you try to go back to that record. Well, you can't go to it if the found set is changed because we can track the record number and it'll change. It might not even be in the found set but even if it's in the found set, it's a record number which is relative to its order inside that found set. Even if you sort it, it messes that up. And another issues happens is what if a window is closed. Well, it's not there anymore. How do we go to it? So I generally don't do those things. Layouts are always going to be there so I like that a lot. So let's go take a look at the scripts we've already programmed. We'll go into Manage Scripts and we'll come down here to our Navigation Section and you'll see Back Store. We'll start with that. And I put these little red arrows next to each one of the script steps that we've added but they're really easy. They're essentially duplicates of the dollar sign dollar sign Back and the dollar sign dollar sign Forward. As you can see, it's just dollar sign dollar sign Forward Record Initialized, Forward Window Initialized and Forward File Initialized. Very simple. Same thing is true here. If you come in here, all you do is change this to Back Record and then change this to Back Record right here and this to Back Record. That's all we change. If you understood it before, you'll understand this. Same thing here with Back Window. We just change this to Back Window and this to Back Window. So all we're doing is we're duplicating this original script step. And same with Back File because we're storing, all we're doing is trying to store these things and they're stored the same way, just in different variables. Now I'm going kind of quick because you should pause the tutorial if you want to copy these things down and implement it in your own solution. So we'll close that and we'll go to our Back Navigate. Now, you can see again we have all these red arrows next to the lines or script steps we've added. And if we look at these ones right here, they're all duplicates of the original. All we did was duplicate the script step, change it to Forward Record and change this to Forward Record and that to Forward Record. That's how simple it was. Same thing here. Forward Window, change that to Forward Window and that to Forward Window. Now, of course, I'm skipping a part. I should point this out. We're also putting in Get Window Name here and in here we're putting Get Record Number rather than what we did on this one was Get Layout Number and of course on dollar sign dollar sign Forward File, we're changing everything to Forward File and putting in Get File Name here. So there are, there are a couple of differences here. I shouldn't say it's just that. Now we're going to skip this part for right now, this if statement and we're going to come down here to our Set Variables down here, which are essentially duplicates of this one. So we'll take a look at them; Back Record and all we had to change was Back Record and Back Record. Nothing else. We're just going in and removing the values. Back Window, same thing. Change this to Back Window, Back Window. All we did was duplicate this original one and change those things. Here's Back File. Back File and Back File. Very simple to do. Let's get on to some of the stuff that's actually fairly brand-new here and this is the Sys Statement here. But before we talk about this, I want to say there's a very important order of operations here. You've got to go for Windows and Files first, then Layouts and then Records. It won't work any other way. You can't go to a record if you're not on the right layout and you can't go to a layout if you're not in the right window or file. So the idea here is let's skip this right now. Let's go to here. All we're doing here is saying Go to Record Based on Calculation. It's the same idea as this. We're just using Record here and we're saying get the value from dollar sign dollar sign Back Record, the first value and then again down here we lop it off once we've gone to it. Up here it's a little more complicated for the Windows and the Files. First thing we do is we check to see is that window there and you can do that with Window Names. It gives you a return-separated list of all the window names that are available, that are open right now and then it, we're adding on a return on each side so we can have every value surrounded by a return. That's so we can uniquely look for what we want with this pattern count. Because what we're looking for is the first value in the dollar sign dollar sign Back Window. We surround that with returns to make sure we find just that window name. Simple as that. If we find out that that window's open, we're going to select it. Otherwise we're going to open the file. Simple as that and the Open URL is how we open that file and we make an assumption here when we're doing this that all of your files in a, you know, multi-file solution are stored in one directory and so if we get the file path of the current file right here, we can change that slightly so that we can look for the other files that has been stored in that dollar sign dollar sign Back File. So we say substitute this with three options here. The first one is get the file name, which does not include the .FP7, so we add that on. Then we say replace that with dollar sign dollar sign Back File the first value basically. So if we find this, Get File Name up in here, then we replace it with the first value from there essentially putting in the new file name that we're trying to go to. And we have to do this again because substitute is case sensitive. Who knows whether you typed your FP7 in lowercase or uppercase and so we do it again. Then the final thing is to change all the file colon slashes to file colon/ slash. That's just what Open URL needs. So it's actually fairly simple what we're doing here. And that's all there is to it as far as the Back Navigate. Now, I'm going to start going through these and actually removing these or disabling them because I really don't want these to run. I don't really like to track all this stuff. I just want to make sure you have it in there. So you can do it if you want to. So we'll save that, go back to Back Store and we'll disable those as well. And then we have one last thing to do, Forward Navigate and all I did was I copied from my Back Navigate to my Forward Navigate all these steps so they're exactly the same except that we going to be Back Record and Forward Record down here so I had to change them and go through all of them. Simple as that. Make sure you change the if statement and the Open URL and the Select Window and the Go to Record. All those have to be changed so that it's basically reversing what we did and it's as simple as that. That's the whole script. So we're going to disable these also because I don't really want them working in my version. If you like them, that's fine by me. But I particularly don't like this, all the hassles that go along with it and so I'm not going to worry about those. So if you want to try them out, you're going to have enable them with FileMaker Advanced. So there you go. All we have, really have left are bells and whistles on this feature. It's pretty much done.
| Course: | FileMaker Pro 11: Advanced |
| Author: | John Mark Osborne |
| SKU: | 34140 |
| ISBN: | 1-936334-36-4 |
| Release Date: | 2010-07-09 |
| Duration: | 14.5 hrs / 159 lessons |
| Work Files: |
Yes |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |