Improving the Experience 2

One of the new features of Filemaker 9 - released a couple of weeks ago in mid-July, 2007 - is something called Conditional Formatting for fields. In earlier versions, display tricks such as red or green buttons, different kinds of text formatting and similar things required some trickery with calculations, custom functions and container fields that would hold color blocks. All this was central to the Lightbar in PolicePro - the row of red and green buttons that displays whether a given police car or officer is in or out of service. WIth Conditional Formatting, I had an opportunity to remove several layers from the existing process.

Lightbar
Of course, that means that to properly take advantage of the new function, we need to rewrite the whole thing. Since we're doing that, we might as well throw in some enhancements that would make sense to the dispatchers running the system.

What a pain in the ass it is to get this stuff exactly right! I rewrote the entire function on a single computer to where it ran flawlessly. When it came time to test it across a LAN with some other desktops, we realized that the red/green stuff I had changed wasn't working over the network the way I had rewritten it. Had to go at it all over again to remove all globals and use calculation fields instead with a new discrete relationship from PolicePro to to a single record in Preferences.

I decided the default state for any new car added to the roster should be a green button and an "In Service" tooltip. Any button that did not have a car assignment needed to open as red with no tooltip notations.

Then it occurred to me that if no location was entered when a green button was clicked, the button should stay green - an additional If statement.

After a day of tweaking and testing, it's this script (times 10, for the 10 possible Lightbar buttons) to control the actions of the lightbar stuff ends up nicely organized, easily readable and very straightforward.

The final step was to go back through the thing and comment the hell out of it for the future, the single most important thing I've learned over the last 11 years of doing this work.

LightbarScript

|