Username:
Password:
FileMaker Pro 9: Advanced Tutorials

Ultimate Find / Dynamic Scripting

Subtitles of the Movie

We're basically done with the Find script, but I'd like to make it dynamic across all tables. In other words, one script that works from customers, products, and invoices, as well as adapts to any new layouts or tables you might add. So it's not that hard. We've in fact already done this many times before. Go into ScriptMaker, locate the Ultimate Find, and the part that's not dynamic is right here. We're saying, Go to this layout. Well, I'm going to ask it now to go to Layout Named by Calculation. Now here's the part that you've done before. Get, Layout, Table, Name. And of course, we need to get left words semicolon 1, that's in case we have something like Customers, or Customers underscore similar. That way, in this case we get Customers, and in this case we get customers, no matter what the layout table name is, or it should say Table Occurrence Name, we'll get just the first word. So since we have good naming conventions we'll get just the name of the table. Then we'll say Ampersand quote underscore find quote. And because we have good naming conventions for our layouts, every time we get customers or invoices, it'll add underscore find, and that will be the name of our Find layout and we'll be set to go. So, it's not very difficult to make this completely dynamic. We do have one more place, which is right here. We refer to customers, so we want to replace this with, quote ampersand, and then quote right there, and we'll move back and put another ampersand there, space, move it back in there, Get, Layout, Table, Name; left words again, and then semi-colon one, and then around this whole thing we want Proper because we want it to be not in all upper case, but in proper case. Then we'll copy this, and then right here is where we want to paste it: quote, ampersand, then I'll paste from the keyboard, ampersand, quote. But this time we want lower because it's in the middle of a sentence. There we go. That's it. There's nothing else that isn't dynamic in here so we're ready to go. This message right here doesn't mention anything but Find criteria, so we don't have to make it dynamic. So, let's try it out real quick. We'll hit Find, notice we go to the right layout; that's good. Type in something that it can't locate. And we can read, No customers. No customers. Perfect. So let's hit no here and now what we need to do is add a special layout for an invoice find as well as a product find. We're going to do the invoice find, but it's up to you to add the Products Find offline. Once you see this it'll be easy. So, we'll go into Layout mode, we'll go to our customer's find, we'll duplicate that layout, go into layout setup; we'll call it Invoices Find. It's very important. Make sure we change this to Invoices because we need to show records from Invoices not Customers now, and you can see how these have changed right here into related fields. We'll change those in a second, and then we'll change our Set Layout order. It's not vital here, but I like to organize things as I'm going along. And then we'll start up at the top here, Invoices, and then very carefully double-click; there we go, got the background here; okay, and then we can double-click on these, change to invoices, and let's see what; let's try Date Post here, and on this one let's go up to Invoices and let's choose Status on this one, and we'll decide not to have a third field here, but you can add another one if you want. So, we'll put date here, and status here. And while we're at it, it's very easy to quickly add a drop-down list with the Status Drop-down List. It's so easy. Let's just do it and make it easy, otherwise these two buttons are going to work just fine. There's nothing we need to change on them, and this Instructions is very good, so we look like we're ready to test it. So, let's go to our Invoices form, we're going to add it to this button; make sure we get the right, there we go; Perform script, Ultimate Find, of course, you're going to have to add this to every find button that you have; we're just adding it right here, but you'll have to go to every invoice's layout. And let's try it out. We'll hit find, right? It goes to the Find Layout for Invoices and we'll type in something here we know it can't find, just a bunch of H's here, hit continue, and we get an appropriate message with the word invoices in it. So, we'll hit no, and it returns us back here. So this is working perfectly. So all you have to do is make your products find layout and add your find script, your Ultimate Find script to every find button you see.

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