VIEW MORE SCREENCASTS   |   MISSINGMANUALS.COM HOME PAGE
 
PLAY SCREENCAST

FileMaker Pro 9 - Naming Objects
7 minutes, 11 seconds

File Downloads

TRANSCRIPT

Hi, this is Susan Prosser, co-author of FileMaker Pro 9: The Missing Manual.

Today, we're gonna learn how to name objects in FileMaker Pro. We'll see how to use the Set Web Viewer Script Step. We'll see how you name an object on a layout. We'll talk about some naming rules.

To get started, let's take a look at the People database that we created back in Chapter 6 of The Missing Manual. You might remember creating a Web Viewer, and the Web Viewer is anchored so that it can expand and contract along with the Notes field; and in this case, it's showing us the Google Maps for the current record that we're looking at.

Now, when you do a plain Web Viewer, it doesn't behave very much like a browser; because you can't make it go forward and backwards like you can your regular Web browser. However, with naming your Web Viewer object and then creating some buttons and formatting them, you can actually remember your surfing history and move forward and backwards through the surfing that you've done.

So now that we've gone forward, you can go backwards. You can have a Reload button; and then, in a moment, we'll see how to program this Home button to bring us back home to where we started.

Let's explore how this is done. These are icons that I've imported from an icon storage, and I've attached a simple script step to the left-pointing arrow. It uses the Set Web Viewer command; and the action is go back; and it's just a simple dialogue box with a couple of choices. The action is just from a popup list.

The important part of this is naming the object, and it's called Viewer. So, again, let's explore how this works.

When I select my Web Viewer, notice my Info Palette. The object name is Viewer, and I named that when I created my layout. So that's how the Script Step knows which object to work on.

This button has a Set Web Viewer Script Step; and its action is to go forward; so it just remembers your Web surfing history and moves forward. This object reloads the page that you're on; so in case some graphics are missing and you just wanna reload, then you can hit Reload and the page is reloaded for you.

This object doesn't have an action yet, so let's see how that works. Going to use the Format command to format this as a button setup. The Set Web Viewer command is almost at the bottom, so I scroll all the way down. I choose Set Web Viewer, click Specify, and I'm gonna type the name of my Web Viewer object, which is just Viewer.

Now, notice, I didn't put the quotes in there; but FileMaker's smart enough to know that this is a character string; and if I simply click Okay, it pops the quotes in for me. I'm gonna tell FileMaker to just Reset, which is its default action, which means that it'll reset to the original settings that you set when you created the Web Viewer, which is dynamically looking up the street address, city, state, and zip of the current record that you're on.

So now that that's done, let's go back to Browse Mode, and we'll see it refresh; and we can also see how, as we surf through our records, Google Maps is reloading with each new address. And then if we go through and we surf, we can see that now we've reloaded our viewing history; and we can move forward and backwards with our button; and we can go back home.

There are some rules to keep in mind when you're naming objects. The name you choose has to be unique on the layout, although you can reuse the name on multiple layouts if you like. When you copy a named object, the name is copied along with that object; but to ensure uniqueness, FileMaker appends a digit to the end of the name. You can live with that, or you can change it to make it more descriptive and unique.

Case doesn't matter when you're naming objects. Use any combination of upper and lowercase that you'd like. You have a 100-character limit, but that's plenty for ensuring uniqueness and making sure the name is also descriptive.

When you're grouping named objects, take some care. You can group them; but if you try to add a name to the set of group objects, you'll find that when you try to type into the field of the Info Palette, it will be grayed out; and that's because FileMaker doesn't allow you to add a name to grouped objects if any of those individual objects has a name. On the other hand, if you group objects and none of them have names, you can apply a name to the group.

Now let's see how we can use the Go To Objects Script Step to change the way a tab control normally works.

In Layout Mode, we can see that this tab control is set so that the default tab is the Resume tab. So when we go back to Browse Mode, Resume will always be active; or when we navigate to another layout and return to the People layout, Resume will always be active.

It may be that, in some occasions, we want the Notes tab to be active. With the Resume tab highlighted, we can look at the Info Palette and see that that object has been given a name and so has the History tab and, finally, so has the Notes tab.

Back in Browse Mode, we can see that there's a script that goes to the Notes tab; and that brings that object forward. Let's look at the script. It's a very simple one-line script that you can add to any of your navigation scripts, and it simply goes to the object called Notes.

Now, here's an example of case not mattering to FileMaker. You might remember that the object was named with a lowercase N. Here, it's referred to with an uppercase N; and it still works just fine. Notice, also, you have a Specify Dialogue box that allows you to calculate in case you want to do a dynamic script name; and you can refer to a repeating field by referring to a specific repetition, if that's what you prefer.