The following video demonstrates how to create a FileMaker hidden tab control. There are occasions when you want to utilize a given space on a layout and make the objects that appear in that space dynamic based on the record type that is currently being displayed. For example, you may have customers and vendors in the same table. You may want to display the customer specific fields when you’re on the customer record and vendor specific fields went you are on the vendor record.
Hi, in this video we are going to take a look at creating a Hidden Tab Control. That’s done with the following steps:
0:06 First you’ll create a standard tab control and put that on your layout. Then you are going to apply the fields, objects or whatever you want to display in that area under each tab. Then you are going to assign a tab panel with an object name. For instance, if I had two tab panels one might be customers and one might be vendors. Finally you will hide the tab and create a brand new script that will switch between tabs using the “go to object” script step. And then you’ll create a layout script trigger which will call your script on record load or at an appropriate time when the data changes. Let’s go take a look at how that’s done now.
0:57 In this video we have a simple contact management database that I just created, and I have two records. One record is a type Vendor and the other record is a type Customer. So there are occasions when you want to use the same real-estate within your layout for different types of information depending on the type of record you’re on. So over here on the right I have a couple of different types of fields. Here are a couple of fields that pertain only to vendors and here’s a field that pertains only to customers.
1:35 So first we’ll draw a standard tab control; like so. I put the customers up ahead of vendors and I’ll go ahead and put the information related to customer on the customer tab and I’ll put the information related to vendors on the vendors tab. Let’s make this a little smaller. And let’s say for example I had some other information down here; I’ll just draw that with it, standard box with a light gray fill. Ok, so a lot of times it’s desired to hide the tab and simply use the area to change dynamically based on the type of record. So let’s go ahead and do that now. Now that I’ve got the tab, let’s go ahead and hide it. Before I do, I’ll go into layout mode and click on each tab panel, open up my inspector and then name the object; in this case I will name that tab customer and I’ll name this tab vendor. Ok, so now we’ll go ahead and hide the object all together. I can make sure I have both tab controls selected which in a sense selects the entire tab control; I’m holding the shift key when I select both of those, and hide and make it where there are no lines, no effects and nothing in the fill. Finally I will double click and make the tab width a fixed width of zero pixels. Back to browse mode and I have completely hidden the tab.
3:55 Now let’s create a script; I’ll call it Switch. And the script is going to be simple. We are just going to create an IF statement that says “If the type equals customer”, and the magic is using the go to object script step. And if it isn’t the customer then it’s obviously the vendor in this case, but you could do several tab controls or several tabs I should say. You could have a customer type, a vendor type, an employee type and you can switch tabs accordingly. So if the type of record is customer; we’re going to go to the object customer, if not we’ll go to the object vendor. And that’s the script and the whole script is called Switch.
5:00 Finally go to layout mode or you can actually go right directly to Manage Layouts, and I will edit that and perform a script trigger. It says “On record load, call the Switch script” that we just created. Back to browse mode. Now notice I’m on record 1 and I’m on a type of customer. If I flip to record 2, because that’s a vendor, I’m now displaying the vendor fields. And you can see here that it’s seamless; that there are fields that are on top of each other because they are hidden behind a Hidden Tab Control.