We will be undergoing scheduled maintenance on May 20th, 2013 at 02:00 GMT.
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.
Now that we've replaced the Forward and Back Buttons with related graphics, we're ready to modify our scripts so they can update those relationships and therefore update those graphics with the right state. So let's go into Manage Scripts and the first thing we're going to handle is our open script. Remember that when we first open the database, we're not going to have any back and forward data in there to show so we need to update those global fields so they have the right value in there, not the last value that the developer left in there. So we're going to duplicate the Set Field at the end, going to change over to Customers and we're going to come and find our xback and xforward. Here's the xback right here. Tell that to change to quote Dimmed quote. Then we'll duplicate it and then simply change this to xforward. That's all we need to do. That'll make sure they're always dimmed when you open up. So we'll save that and then we'll go to our Back Store. So type in Back here, there's our Back Store Script and what we're going to do is whenever you use the Back Store Script, you're navigating somewhere brand-new and whenever we do that, we have no forward information so we're going to set the xforward to Dimmed but we're all of a sudden going to have back information so we're going to set the back or xback to Back. So it's a real simple script. We just simply set it X Forward to quote Dimmed quote. We'll duplicate that and we'll set xback to the word Back. Don't make it any more complicated than you have to. We simply know that if we're navigating somewhere new, that the Forward is dimmed and the back has that Back Button in it. There's no other choice. There's no other way it can happen. So we'll save that and then we'll go to our Back Navigate. It's right here. We'll edit that one and right below the Set Variable here we're going to put in a new Set Field. What we're going to do is we're going to set our xforward, we're going to automatically set that to the word Forward. Simple as that. As soon as we navigate backwards somewhere, we automatically at that point have some forward history to go through. And there's no other choice. It's really as simple as that and once we hit the Back Button, we're going to have forward history. So that one's pretty easy. And let's go down here to after this Set Variable and we'll put in another Set Field and before we program this one, we really could put these Set Fields anywhere we want and this one can go anywhere in here but it, it just seems to kind of go long. As soon as we change this value, just, you know, change this value also. They seem to go together in my mind. Especially in this case because we're going to be eliminating values from dollar sign dollar sign Back. As soon as we get to Empty, then we want to go ahead and change and dim this out. So this has a little bit more logic in it, this one for the xback. So we come down here and choose it and type in Case open paren and we're going to type in here is Empty. Actually I'll put a couple returns, is Empty open paren dollar sign dollar sign Back close paren semicolon. If it's empty, we want a result in the word Dimmed, otherwise we're going to result in the word Back. So each time we go ahead and remove a value from our dollar sign dollar sign back with this formula, we then immediately after that are going to check to see hey, are all the values gone? Should we dim it or not? And it often, it'll go ahead and put the same value in there over and over and over again because, you know, you're going back, you may have let's say ten levels of history. It might put the same value in but that won't really hurt. It's better to do that than to just try to make something more complex here than we'd, you know, not and you say oh, let's not put anything in there if it's not dim. This is much easier just, it won't make any slower, faster doing it this way. You'll just make it easier to program. So we're going to copy these, go in here, use the keyboard command. If you have FileMaker Advanced you can copy them. If you don't you're going to have to reprogram them but they're not that hard to do. So we'll save that, come into our Forward Navigate, edit that, paste it right in there, then move this one down, get that one just selected, there we go. Move it down to where it should go, right in there and then all we have to do is reverse these. Double click on this and change this to xback and then change this to Back. Then we'll come down here into our dollar sign dollar sign Forward Set Field, I'm sorry, this one right here, change this to xforward. I just hit the wrong button there. Change it to xforward and then specify this and reverse this. We'll change this to dollar sign dollar sign forward and then change this to word Forward. So hopefully we've got everything right. Let's go ahead and test this out and see how it works. We'll save this, close that and see what we can do here. Let's go into our Data Viewer and we'll remove this but that won't update these things so what I'm going to do is I'm going to close and open this. That way we can really test everything and we'll put in 1, 2, 3, 4, Admin. Can see we open it up, our buttons are dimmed. I'll navigate somewhere new. You see it's populated this. If I hit Back it populates it forward. If I hit Forward and it's gone, it's empty. If I hit Back twice it's empty so this looks like it works perfectly. Now what we're going to discuss in the next section is how to take this onto all of our other layouts; Invoices and Products.
| 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 |