Home
Username:
Password:
FileMaker Pro 10: Intermediate Tutorials

Multi-User Solutions / Retrieving a Found Set




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.


Learn More

Subtitles of the Movie

Now that we've written a script that stores the unique identifier for every record in the Found Set as a Multi-key, we can proceed with the script to actually restore that Found Set. So as a reminder, let's take a look at our Multi-key and remind you how it works. So we'll go over to our Paste Serial and the way a Multi-key works is, if you use this xserial field as the primary field in a relationship it's going to see each one of these return separated values, because there's a return here, here, here, and here, each one of these return separated values will be seen as a separate match, so it could see Invoice 1 or Invoice 5 or Invoice 6. Now this is different than when you're using multiple key fields. So if we go into Manage, Database and take a look at this relationship, for instance, we'll just double-click on it, this is using two Key Fields. That's an And, and you can, in fact, see it here. A Multi-key does an Or, so it's important to know how to do a Multi-key so you can create these types of relationships. So, now we're going to create a new Table Occurrence. We're going to relate our xserial to our Serial Field, we have that relationship. So it's going to be Invoices to Invoices, so we're going to find Invoices again and we're going to call this Invoices underscore Restore. There we go, make that a capital R. And then we're going to connect Invoices up to Invoices Restore. Now it's very important that we use xserial on this side and not on this side because we're going to be running the script from here. This is our starting point. The layout where we run it from will be attached to this table occurrence. Over here, it's very important that we do Serial Number, and I always keep forgetting to look for S for Serial Number, but it's not there of course. That will be our KP Invoices ID. So here's another reason. Notice it has this flat line, this stop sign here. That means that if we're starting here our layout's based on that, we have to go this direction. We can't go from this direction to that, in fact, we don't even have a layout based on this and we don't need one. So, very important you get these set up the right way, connect at the right direction. So once we have this setup, now we can come in here and write ourselves a script. So we'll make a script called Restore Found Set and it's going to be real simple, Go to Related Record, that's it. That's all we need. We'll come in and Specify. Our starting point is our Invoices Layout, which is attached to the Invoices Table Occurrence, and we don't want it to go back to itself, we want to go to Invoices Restore, go across that relationship, remember our whole long discussion about start and end, it's very important and will be ever so more important as we go along. And then we can say, Show Records Using the Current Layout, and that's going to be a Layout based on Invoices not Invoices Restore. Well, the neat thing is you'll go from Invoices to Invoices Restore and we'll use that Go to Related Record with the Show Only Related Records and Match Current Record Only; when we do that, what's going to happen is we're going to make a Found Set but then we're going to transfer that Found Set from Invoices Restore back to Invoices because they're saying show it using this layout, it's just the way it works. We could have showed a layout using Invoices Restore, but we don't have any layouts based on that. We'll go, it's almost like we're starting off from Invoices, going to Invoices Restore, making a Found Set and then Invoices Restore, but going, Hey, we don't have a layout, so we're going to transfer that Found Set back to the Current Layout, or we could have transferred it to Invoices List if we wanted and that would have worked the same. The key here is that we're making it based on a layout that's not this one. Usually you choose a layout based on this one, but we want it to kind of do that reverse thing, go and make that Found Set and then bring it back. And this is the easiest way to do it. So we're going to continue to use Current Layout here, click OK, and that's it. That's your entire script right there. So we'll Save that. Close it. Switch back to our Invoices Form, and we'll shrink that up, there we go. Remember we did a Show All Records, so there's all records showing, and we had five records saved, so let's see what happens. And you can see now we have our five records back. Simple as that. We can save our Found Set anytime we want, we can come back in here and maybe Omit another record and then say, OK, now I want to save that, we save it, and when we'll Show All Records just to prove it's working, and then restore it and we're back to four records. Simple as that. Very easy to work with. It just makes life so easy and we don't have any record locking issues here, but we do have some limitations because we've used the most simplest approach to restoring or saving and restoring a Found Set, so we want to point out the limitations because in the Advanced tutorial we're going to go over more advanced versions of this that don't have these limitations. One limitation is we can only store one set. We've stored our serial numbers in a Global Field, so that means that each user on the network can have their own Found Set stored, but what's going to happen is that they can't store, let's say, five or ten Found Sets if they want. In addition, Copy All Records, as we mentioned before, destroys the contents of the Clipboard and I try to avoid that if I can, but we're going to find other methods to get those serial numbers into a Multi-key for us. And then of course, back to the Global Field again, what's going to happen is, as soon as that person closes the file in the multi-user scenario that Found Set's going to be gone. So we can't save it permanently and we'd really like to have these Found Sets retrievable a week down the line, a year down the line, however long that person wants to save that Found Set for, we'd like to keep it for that long.

Tutorial Information

Course: FileMaker Pro 10: Intermediate
Author: John Mark Osborne
SKU: 33926
ISBN: 1-935320-19-X
Release Date: 2009-01-05
Duration: 15 hrs / 177 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
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available