Thursday, July 5, 2012

Pre-Troubleshooting FileMaker databases

It's important to think ahead when designing software (or anything, for that matter). 10 minutes of planning will save 90 minutes of work.


So I'm designing a database and thinking to when IT (i.e. me) will have to troubleshoot it.

There are places where I might want to show certain types of data only when troubleshooting. I can put fields on all the layouts (of which we have a lot), but it's a lot of adding fields and then removing them when you're done. I'd rather just make them visible/invisible at will.

So for the moment, I've created a variable $$MetadataVisibility, a global one (obvious from the "$$") set by the following script:
  1. Set Variable [$$MetadataVisibility; Value: If ( $$MetadataVisibility = 1 ; 0 ; 1 )]
  2. Refresh Window[]
Then I add a "Conditional Formatting" formula to all of the troubleshooting fields:

not $$MetadataVisibility

 which if true sets the field text to match the layout background color.

In effect, by running the script (easily by pressing Cmd-1, since it's first in my scripts menu), I can turn all the troubleshooting fields on or off just for me (since global variables are for the local user, not for all users).

Of course, once we go live I'll need some safeguards in place: making sure only admins can access the script, that no one accidentally clicks on a field and modifies the data, etc. But that's trivial.

No comments:

Post a Comment