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.
So after they've entered their data we're going to immediately close that window because we don't need it anymore, then we're going to enter Find Mode, there we go, take the Pause off, we don't need that anymore and as soon as we enter Find Mode we're going to start looping. Now what we've done so far are Record Loops, Field Loops and Scripted Loops. A Record Loop, an example, that would be when we gathered our serial numbers. A Field Loop would be, an example of when we parsed our Find Criteria and a Scripted Loop would be what we did in Ultimate Find where we're just simply looping through scripts steps and doing them over and over again. We actually did quite a few examples of those. We did it in our Discount script also. But what we're going to do here is a Data Loop. We're going to loop through that return separated list that the checkbox makes and pull out the data, so we're going to need a Set field, an Exit Loop If and then also a New Record Request. I often put in these steps here knowing what the basic idea is, the overview is and then fill them in later. I'm going to go with the easier one - when do we exit? Well, we're going to exit when we have enough requests. How are we going to know how many requests we have? Well, we're going to: get requestcount; that'll tell us how many requests we currently have and does that equal the valuecount of our xcategory field. Remember that the value count counts the number of returns or the number of values in a field and so it'll know how many those are and if we've gotten to the right number of requests because what we're doing is every time we're looping we're creating a new request. So as soon as we've got enough requests it will exit that. And then our Set Field's going to specify our Category field. What are we going to specify in there? Well, this is kind of the magic part. We're going to say: getvalue. Now getvalue has two parameters. The first one is where do you want to get a value from? And it's getting a value, kind of like valuecount, but it's getting a value out of there, grabbing one, so it works, it's in the same vein as valuecount. It looks at values. But it says grab a specific value, so we're going to want to grab a value out of xcategory. Then we're going to say, well, what value do we want? Well, it's going to be changing as our requests grow so we'll use: get requestcount. That will allow us to grab the right request or the right value from xcategory when we're on the particular request and it'll go right through them, 1, 2, 3, you know, as many requests as there are, that they've checked, it'll go through and grab each one as we loop. Now we'll go ahead and Perform the Find and I passed it up there. There we go. Perform Find Replace, didn't pass it up, I didn't quite get to it. Let's try that Type Ahead again. There we go. Found it. OK, put that in there and then if there's an error, because it's possible that there may be no categories for it: If Get LastError equals 401, if that's true then we're going to show a Custom Dialog, we'll put: No categories - No customers with the categories selected were found. There we go, put a space in there, take the Cancel button out, click OK. Otherwise we must have found records so we'll put an Else in there and then we'll say: If Get FoundCount equals 1, if that's true we'll perform a script to go to, we'll just type in goto. You can see how great it is when we have good naming conventions here to find stuff. We'll say: Go to Form View, otherwise we'll go to List View. And we'll come in there and change it to List View. There we go. So that's our complete script. Let's go ahead and save this. Uncheck it so it's not under there. Double-click on this button here, change it to that new script, there we go and we're ready to go. We can try it out. And we'll tighten this up a little bit, click on the button, notice how it's perfectly centered in the screen which is great. We can check on multiple categories, hit Continue, shows us our list. Now we could go through each one and make sure it found the right ones, or we could go to Modify Last Find and see what it found us. You can see that the first category that it searched for was Government, but you can also see that we have several requests. The first request is Commercial, so it did exactly what we wanted, and so we've got a perfectly working solution here. So the idea here is that we've made it much easier for them to do a New Request Find. Now realize you can take this basic technique and add regular fields to it. In this area we could put regular fields and all you have to do is duplicate them on each request, put the same value because you'd have the checkbox fields and then the regular fields that should be searched, you know, it might be Commercial and Company, Government and Company, Non-Profit and Company, the same company over and over. So you can mix this with regular finds just by duplicating that value on each request. And this also gives us a chance to test our Cancel button which seems to work perfectly. Always check to make sure there's no scripts running. So we're really ready to go here. So, always remember make the job easier for the user. It'll really benefit you in the long run and prevent those phone calls from people asking how to do things. Make it easy for them, spend the time up front and you'll spend less time afterwards and everybody'll be much happier.
| 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 |