Username:
Password:
FileMaker Pro 10: Advanced Tutorials

Ultimate Find / Save by Table Occurrence pt. 2

Subtitles of the Movie

Now, we can't make this as dynamic as we've made everything else, so you're going to see a bunch of If statements in here. We're going to say what layer are we on? Get layout name, Left Words, is it Customers? That little trick we've done over and over. Is it Invoices, is it Products, and so on? Well, if it's customers, run this. Essentially what we just showed you. If it's invoices, same idea. If it's products same idea. Go to itself, show in a layout based on a different table occurrence. Show only related records. Then, once we're done, go back to the original layout. In other words, we're going to start off on let's say customers, go to related record, then quickly come back to the record where we started because we don't really want to see the saved layout; we just want to save it there and come back for it later. So once we've saved it let's hit Don't Save here we'll go to Restore TO and we have the same idea. Is it Customers? Is it Invoices? Is it Products? If that's true, then we do Go To Related Records, just like we showed you in the Test version. The only difference is we have layout number by calculation and what we have specified here is Get Script Parameter. So you'll see how this works. I want it to go back to the layout where they started from. We could have gone back to a standard form layout, but I really wanted to make it extra special, so you'll see that on each one of these we have the option Layout Number By Calculation and Get Script Parameter, so we have to look at where it's called from to see what that script parameter is. On this one, same thing, Layout Number By Calculation, Get Script Parameter. So the same idea as we showed you in the test. The one difference here is that we have Go To Layout and we use that little technique. Remember, it's Layout Name By Calculation. We say Get Layout Name, get the Left Word, and then add Save onto it, so no matter what Find layout we're on, we're going to take just that Customers or Invoices or Products name and then add Save onto it, and since we have good naming conventions, it'll go right to the correct Save layout and then it'll determine where we're at and perform the right Go To Related Record to restore that table occurrence. So now all we have to do is figure out where we want to put this in the Ultimate Find. So in the Ultimate Find, we want to put it somewhere before we change layouts. Perform Script Saved TO. Simple as that. We could actually do it after we go to the Find layout. That wouldn't be a problem, but it seems to make sense for me right here, but we could do it up here if you want. It's all up to you. I just put it here. Then, a little bit more complicated is our Perform Script Restore TO. Notice that we've removed our Show All Records and our Go To Layout, Original Layout, and notice that when we call it, we say send the parameter dollar sign, last layout. Well, that's up here. That's the layout we've saved as where we started from, so that's why we're passing that over there to this Restore TO and we grab it using Get Script Parameter. So let's test this out and see how it works. So, we've gotten Customers. Let's make a found set. Let's omit another record so that it's different than what we had. So now we have two records found. We're going to hit our Find button. We're going to type in something it can't find, hit Continue. That's because Set Error Capture is off. Here's the message your users will see. We have zero records found right now. You can see it up here in the top. We'll hit No, but we actually come back to our two records found. So a great little technique, put it on your tool belt as one of your hammers. You know, you have the hammer for saving found sets with serial numbers, which we'll go over more later on. We have this new technique. You also have to remember the new window technique and we even have one more technique we'll eventually show you, so you have all four of those hammers on your tool belt. Pull out the right hammer for the right job.

Tutorial Information

Course: FileMaker Pro 10: Advanced
Author: John Mark Osborne
SKU: 33927
ISBN: 1-935320-20-3
Release Date: 2009-01-05
Duration: 12 hrs / 150 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
  • 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