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.
Let's continue on with our Multi-User Preferences by adding fields, relationships, and scripts to the solution. We're going to start by adding our account current. So we're going to go to Manage, Database. We're going to go into each of our tables CUSTOMERS and add account underscore current. That'll be a Calculation field. We've done this before in the Intermediate tutorial. Come into Storage Options, make sure it's not stored and then put in get accountname. And we'll fix that little problem there. So what this allows us to do is to have the currently logged on person, their account name, on every record in CUSTOMERS. Make sure you have a Text result here and the reason we want that is no matter what record we're in CUSTOMERS, when we go to Preferences we want to make sure we get to the Preferences for that particular account because we're going to have many records inside of ACCOUNTS. So we're going to copy that using FileMaker Advanced, come over to our INVOICES and look in here and I believe we have, actually I double-clicked on the wrong one there, we already have account current here for another reason so we can reuse that and then we'll go into PRODUCTS and do the same thing. See, we don't have it here? So we'll paste it in there and now we're done with that. Now what we need to do is add our relationships. So here's our accounts and I'm going to rename this accounts underscore customers. Click OK. We're going to relate this over to our CUSTOMERS, so let's drag it, any two fields for starters, over here we're going to choose Account Create and over here we're going to choose account current. And we'll Type Ahead and find it. There we go. Well, that's Account Create, account mod, I believe it's down at the end here. There it is. So we'll change that relationship. So that means that no matter what record on CUSTOMERS you're currently on, if you go to Preferences or try to get a value from Preferences you'll know which record to get those preferences from based on your record for that account inside the ACCOUNTS table. Now, we could stick with this if we wanted to and not add an ACCOUNTS Table Occurrence attached to INVOICES or PRODUCTS. The problem is, is that what if we have an invoice, you're on an invoice that has no customer? Seems unlikely, but it's a possibility. So if we're on an invoice that has no customer, invoices doesn't relate to customers and therefore you can't see the accounts over here. Most likely almost every time you're going to have that customer, but it's possible you want to change Preferences right after creating an Invoice, so we have to worry about that, and the same goes for Products. If there's no invoice it can't see all the way through. Now if there is one invoice for every customer and the products that have been sold on every invoice you're not going to have any problems, but I don't like to worry about those things failing so we're going to duplicate this. Actually, we're going to duplicate it twice. I'm going to name this one ACCOUNTS Invoices and ACCOUNTS Products. And, really, we should do it for any other place we might need to go to Preferences but I think this handles most of it. And things are getting a little messy here. Don't worry too much about it. We'll clean it up at a later point. Sometimes when you're right in the middle of things you don't want to clear this up so, now, Account Create's right there so I'm going to go ahead and account current's right here so we're set to go. That's because it's already related to our Set's conditional, so that one's done. And then we can come down here and get our ACCOUNTS Products. Oops. There we go. Open that up, go from Account Create to anything over here, double-click on it, go down to the bottom, there we go, change it and now it's all set up. So now we have all our relationships so no matter where you are you can see the correct Account and therefore the correct Preferences. So we'll click OK here and one of the things we've done offline and this is not necessary to have on here but just for testing purposes we have on this layout what the Account Name is, so we don't have any records right now, which is why when we go into Browse Mode you'll see that there's nothing in there. That's because we have no records. But we're going to take care of that later because we have nobody who's signed on yet.
| 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 |