Username:
Password:
FileMaker Pro 9: Advanced Tutorials

Ultimate Find / Continue & Cancel

Subtitles of the Movie

It's a good idea to make your solutions friendly to mouse people and keyboard people. And here's what I mean. If we go into Find mode and you read your instructions, there is no Continue button to be seen unless you show the status area. Now, we could show the status area, but I don't want to confuse them with all this other stuff that's in there. What I'd rather do is put a Continue button on here and a Cancel button so that both the keyboard people want to hit the Enter key and the mouse people want a Button, are both happy, so that the system works with both of them. So what we're going to do is go into Layout mode, that'll cancel our script, and let's go borrow a button. We'll grab the Find button here, copy that, come back to Customer's Find, and then we'll paste, move it on over here, somewhere to the right, get it lined up pretty good; we'll see how well we did. That looks pretty good. Double-click on the text so we can enter Continue here, and then double-click on the button and all we want to do is resume script. That simply clicks the Continue button you see in the status area. It's that simple. So we've completed that, but now we also want a Cancel button, which would be really nice. What if they get in here and they don't want to actually run the Find script, how do they get out of here without running an actual find? Well, we can fix that. What we're going to do is hold down the Option on Mac, or Control key, and then drag, and then hold down the Shift key so it's lined up. And you can see how quickly that made an exact duplicate of everything that was selected. We can then double-click on this and change it to Cancel, and then what we need on this Cancel button is we need to do more than one thing. We need to go back to the original layout, and we also need to enter Browse mode. So, let's go into ScriptMaker and we'll make this script called Cancel, and it'll enter Browse mode and go to Layout, Original Layout. In the order these don't really matter. Ah, sometimes it does when you're writing scripts, but in this case it doesn't. So we'll save that, take that off the scripts menu, double-click on this, perform script, and we'll scroll down here and choose Cancel, and let's test this and see how well it works. So we'll go back to Customer's form, go to Browse mode, click on our button; let's try out the Continue button first, so we'll type in J-o-h-n, hit continue, and it works great. You can see how it goes right to our Find, our through records are found. Now let's see what happens when we hit Cancel. We decided we don't want to be here, so we click Cancel, and it does go back to Browse mode, but it doesn't go back to the original layout. The reason is because you're clicking this button and its original layout is this layout where you clicked it. It's different with the Find script. With the Cancel, you're actually clicking here and it's going, Okay. I'll go back to the original layout where you clicked here, I'm going to go back to this layout. So what we're going to have to do is program the go-to layout, original layout, but program it ourselves so it works more the way we want it to in this situation. And you'll find yourself doing that a lot in FileMaker. A feature doesn't quite work the way you want it to and you have to re-program it, and it's really not that hard. So, let's go into Layout mode; we'll eventually need to be there. And then we'll go to ScriptMaker, and we need to start with our Ultimate Find first. Before we leave this layout, you know, the layout that we're clicking the button on, before we go to this layout right here, we need to do a Set Variable. Now, you could also do a Set Field into a Global Field, would work just fine, but I'm using a variable here and we're going to put in dollar sign, dollar sign. We going to have to put in two dollar signs and make it a global because we're going to set the variable in the Ultimate Find, but actually refer to it in Cancel, and if it's not a global, it'll be gone after Ultimate Find is done. So, we'll put in Last Layout, and then we'll specify the formula, we'll use a get function, and there're several get functions you can use here. You have Get Layout Name, and Get Layout Number. Either one would work fine here as you'll see in a second. I'm going to use Get Layout Number, just because that's the way I was used to it. Get Layout Name came afterwards. That's the only reason here. You could use either one in this case. So we set that variable, save that. We'll come to our Cancel, and instead of going to Layout, Original Layout, we need to do Go to Layout Number by Calculation. You can see there's also Name, but I've used Number here because that's what I've stored. And what we're going to see is dollar sign dollar sign, last layout. click OKay. Close that. Hit save. Close that. Go back to Customer's form, go to Browse mode and let's try it out again. We don't want to be here. We put Cancel, and it looks like it's working great. We're getting back to the layout where we started from. The only problem is, if you show the Status area, your script is still running. What script is running? Well, the Find script is, and we can fix that easily too, so we'll hit Cancel here, go to Customer's find, and then go to Layout Mode, and if we double-click on this, make sure we get the script, there we go, you'll see that we have this option here: Pause, Resume, Exit, and Halt. The default is pausing and the most common choice. What it says is, Run this cancel script and then, once you're done running this cancel script, any scripts that are currently running, pause them. In other words, keep them paused, because it would have had to have been paused in order for you to click on a button to run it anyhow. So that's what you want in most of the cases, but sometimes you might want Resume. Resume says, Run the cancel script, and when you're done, click the Continue button and continue running the script that was paused, in other words, the find script. We don't want that in this case. We actually want to Exit or Halt. I'm going to choose Halt here and the reason is because I want everything to stop. This halts all scripts whereas the Exit script, if you're in a subscript, one that's been called by a Calling script, it will halt the subscript and then go back and start running where it left off in the Calling script. Halt says, Stop everything, and is a better choice here in case I end up having any subscripts. I really want everything to stop. So we'll try this out. Go to Browse mode, hit Find, decide we don't want to be here, hit Cancel, and you can see now that the Continue and Cancel are definitely gone.

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