FileMaker 11 added just one new object trigger, and it is a strange little dude: `OnObjectValidate`. This trigger fires after you edit a field, before it is validated. If you thought FileMaker already had enough after-you-change-a-field triggers, you were mistaken. In this article, I explain how the various field triggers fit together and why `OnObjectValidate` exits. You then get a simple example of how it can be used. And as a special bonus, I show you how to extend the technique so it can easily be reused over and over again.
Not of the faint of heart, these posts talk about advanced (and oh-so-cool) FileMaker Pro tips and techniques.
Pop: Goes the…um…Variable
We start our return to semi-regular writing with a small-but-awesome custom function: `Pop`. If you grew up in the American mid-west like me you might think I’m talking about [soda|soda pop|coke|soft drinks]. But I’m actually talking about [stacks][pop]. In the computer science world, `pop` means to take something off the top of a list, and it is exceptionally handy to make it easy in FileMaker scripting.
Using Global Variables for List Selections
A funny thing happened while I was stumped over the question of how to allow one of our clients to select and deselect multiple items in a list. Multiple people would be using the list at the same time. I was struck by the fact that I’ve been making something more complicated than it needs to be for as long as I’ve been working with Filemaker. After toying with various methods which included adding fields to the records in the list, join tables, global fields and horribly convoluted scripting it occurred to me that you can actually write a relatively simple custom function to handle it all. It will add or subtract a value from a list that is stored in a global variable and then simply do some conditional formatting to highlight the selected items in the list. No additional fields or scripting are needed, the global variable is session specific and once you are done you’ve got your list of data ready to go as is.
Script Triggers: Filter as You Type
For years, FileMaker developers have been devising various *filter* techniques. The idea is that you type all or part of a name, part number, description, etc… and a list of results filters down to show relevant matches. As handy as these techniques are, they always stop just short of perfect because, before FileMaker 10, you had to *exit the field* before the filter would take effect. Using FileMaker 10’s powerful Script Triggers, you can make the impact of your filtering more immediate.
Script Triggers: Using the Keystroke Trigger
Adding Script Triggers has opened up a world of possibilities for FileMaker developers. Each different type of script triggers has it’s own nuances and pitfalls to be aware of. In fact, with script triggers, FileMaker, in some ways, begins to expose the complexity of more advanced programming environments. Nothing illustrates this more than the `OnLayoutKeystroke` and `OnObjectKeystroke` triggers. In this article, we’ll look closely at keystroke triggers: the most powerful and complex of the triggers in FileMaker 10.
Set Field by Name Exposed
In our [article about FileMaker 10][fm10], we promised some tips on using the new `Set Field by Name` script step, which gives FileMaker the power of _[indirection][indirection]_. This is a complicated concept, and we’ll be posting some real world examples along the way, as well. But first, we’ll give you a full explanation of the new script step and function that make indirection possible.
[fm10]: /wp/introducing-filemaker-10/ “What’s new in FileMaker Pro 10”
[indirection]: http://en.wikipedia.org/wiki/Indirection “Wikipedia on Indirection”
Filemaker Server 10 New Features & Backup Scheduling
At long last, 10 has arrived! After all the tantalizing little glimpses that we got last devcon, I for one am glad we finally have something we can get our hands on. There are a lot of new features and changes to go over, and I’m going to mention them all here, but for this particular article I am going to be focusing on the huge improvements to backup scheduling and how the configuration methods have changed for the better. The level of depth in the scheduling options that the new Retention setting and souped up controls over the timing of the schedules is a big step forward. Essentially, one schedule can now take the place of many. So, without futher ado, onto the details.
Alternating Color Based on Alternating Data
An interesting question popped up on the TechNet discussion list this evening:
>I have a list of records with dates, which often repeat from one record to the next. I want all the same dates to be one colour. Then the next date would be another color. The background color of the date field would alternate from one color to the other as the date changes.
I’ve never run in to this need before, but it sounds like something that would come in handy. It also proves to be just enough FileMaker challenge to be interesting. Here’s how to make it work.
Duplicating a Set of Records in FileMaker
Duplicating in a Record in FileMaker is very easy…. but a found set???? That takes a little bit of thought. Here is how I would approach the task.
Restoring Active Tab State
> Out of Date: If you’re using FileMaker Pro 10 or later, you can accomplish the goal in this article more easily using script triggers. See [this newer article](http://sixfriedrice.com/wp/script-triggers-monitoring-and-restoring-tabs/) for details.
If you use Tab Controls a lot (and don’t we all?) then you may have run into a little snag: When you switch to a different layout, then come back again, the default tab panel comes back to the front. This is usually not a big deal. But sometimes you have a script that switches layouts just for a moment. When this script runs, the user never sees the layout change, but they *do* see the tab control mysteriously bounce back to its home base. This article shows you how to fix this problem once-and-for-all.