Note: This article assumes an intermediate familiarity with FileMaker Pro. Also, costs figures used in this article are made up.
FileMaker 10 gave us script triggers which let us call scripts when when users or scripts switched layouts and records, when fields are entered, modified, saved or exited. Script triggers revolutionized what we could do as users navigated through our solutions. FileMaker 11 introduced a new script trigger: OnObjectValidate. I had not used this trigger until I needed to solve two thorny issues in a recent solution. I thought these specific applications of this trigger would help others understand how to use it better.
You will benefit most from this article by first reading The OnObjectValidate Trigger written by Geoff Coffey of Six Fried Rice. Geoff’s excellent article helps you understand this trigger and its uses. My article gives two examples of this trigger’s use.
In a large solution for a local printing company, customer service representatives, CSRs, select the specs for a print job in a portal. A customer orders 10 packs of forms and each pack consists of 100 sheets, padded on the back, glued at top with three holes drilled in the left margin. Each of these related specs must be linked with another record in a cost table that fills in the spec’s cost to produce. So choosing “Drilling: 3 left” for this product links to a cost table so this spec gets filled with a cost $1.64 to 3-hole drill 100 sheets or $2.38 to drill 10 of these packs at once. One problem we had to overcome is that old, legacy specs were often manually written, so when a product is ordered that hasn’t been ordered in the new system, customer service personnel must convert these legacy specs to the new format by selecting new spec types and details. To convert “Finishing: Drill 3-hole left”, the CSR must change “Finishing” type to “Drilling” and “Drill 3-hole left” detail to “3 left”. (Of course, we converted most of these prior to the system going live.)
The problem we had was that that specs normally are selected from a drop-down menu that populated the cost key value. Then the spec type, description and cost is auto-entered. When dealing with legacy entries we looked up the key value through a relationship using the type and description.