0% found this document useful (0 votes)
369 views10 pages

21 Secrets of Filemaker

Secretos de FileMaker
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
369 views10 pages

21 Secrets of Filemaker

Secretos de FileMaker
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

21 Secrets of FileMaker Pro

Take FileMaker Pro to the Max!

FileMaker® Pro customers love how it lets them do more faster


and gain insight into their data. And they want to become even
more productive and creative. These “21 secrets” will help you take
FileMaker Pro “to the max” whether you’re brand new to FileMaker
or a vetran.

You’ll also find hundreds more tips online within the FileMaker Te-
chInfo Knowledge Base at:
www.filemaker.com/support/techinfo, and FileMaker Advisor Magazine at:
http://filemakeradvisor.com.

8 SECRETS FOR FILEMAKER PRO BEGINNERS


#1. Change your layout unit of measurement via the Object Size palette.
Being able to exactly position things on a layout is vital if you care about the consistency and presentation
of your database ... unfortunately, inches aren’t well suited for work on a computer screen and thankfully
FileMaker Pro allows you to switch to the far more useful pixel unit.
• Change the default unit of measurement for the current FileMaker Pro file by clicking on the units
indicated to the right of the palette fields: You’ll toggle through inches, centimeters and pixels.
21 Secrets of FileMaker Pro

# 2. Use arrow keyboard shortcuts to flip between elements.


Using keyboard commands will speed your development and make you more facile with FileMaker Pro in general.
One of the often-missed shortcuts are the up/down arrows.
Use Control-Up or Control-Down to move through layouts in Layout mode, records in Browse mode, find requests
in Find mode, and pages in Preview mode. It’s a simple tip, but one well worth knowing!

#3. Use naming conventions and comments to keep yourself organized.


No matter where you are on the curve of becoming a professional developer, it’s important to foster good habits
from day one. Even if you think no other human will ever see the database you’re creating today, you yourself will no
doubt return to it in the future.
• Use basic naming standards for organization and maintainability. If you’re working with a team this is an obvious
and necessary element, but even if you’re on your own and know your system intimately, we can guarantee you’ll
forget what something does in six months time.
 File names
• Create a unique prefix for your filenames. This prevents your files from being confused with
others of similar names on the same FMP server, and nicely identifies groups of files used for
the same solution. Files belonging to the same application should all have the same prefix. For
example: sales_Contact.fp5, sales_Transaction.fp5, sales_Company.fp5, etc.
 Key fields: name the ID fields in your solutions explicitly so that when building relationships or other
use of them, they’re always identifiable and grouped together. Here’s one standard approach:
• Key_P_ID_Contact (P means primary key)
• Key_F_ID_Contact (F means foreign key)
• Key_C_Contact (C means compound key)
 Relationships: reference the field names in the relationship name. On Windows, long relationship
names can be a bit unwieldy, but in the long run, you’ll save a good bit of hunting when you’ve
accidentally broken the relationship with <field missing> or some other problem.You can, if you
choose, opt to skip the abbreviation prefixes as we do here:
• Address.ID_Contact (a relationship to the file ‘Address’ that is based on the “Key_P_ID_
Contact” field.)
• Always use script comments! If nothing else, a single comment at the top of the script with that script’s
purpose. It is also a good idea to add who wrote it, when created, and when it was last modified. Also, add
comments on dependencies... for example, if the script needs to be run from a particular layout, or assumes
a certain condition in the found set.

#4. Establish a ‘main’ file for your multi-file solutions with opener routines.
Main files, even if they’re a part of your data structure, are useful if only to put all the stuff that might arbitrarily live
anywhere in a single, central location. This will help keep you organized and will certainly help others understand
your system if you ever need to share with other developers.
• Use a ‘main’ file to act as menu and open all other files in a solution. Set other files to ‘Multi User Hidden’, so
that only the main file appears in the Hosts dialog.
• This main file need not be an additional file... you can certainly have it be one of your data tables as well.
Regardless of whether or not you use the all-interface-in-one style of development, or use the distributed UI
approach, it’s a good idea to give users a “place to start.”
• Put globals and other “central” resources in your main file. This will help you stay organized.

#5. Write ‘clean’ calculations.


We can’t stress how helpful it is to have good habits like brushing your teeth and writing clean code.You and your
peers will thank you later.
21 Secrets of FileMaker Pro

Use plenty of white space and use nesting (by inserting hard returns and spaces) to make calculations more readable.You
may also want to put error messages in your assumptions as you build a complex calculation. They’re handy to leave in
the formula in the chance that you need to edit in the future

#6. Disable script steps without deleting.


Preserve your work: if you need to test or disable script steps, you can opt to bypass them without having to delete
them and lose that branch of logic. If you complete testing or discover you did need the steps you’ve bypassed, it’s a
simple matter of reinstating them without having to rewrite the script.
• Common testing and development often requires that you “turn off” certain script steps. Rather than deleting
the steps or duplicating the script in question for further editing, simply use a conditional statement that will
always resolve as “false.” Use If[0] (zero) to comment out script steps when testing or debugging:

Allow User Abort [ Off ]


Set Error Capture [ On ]
Go to Layout [ Layout #1 ]
If [ 0 ]
# “ nothing inside this If statement will execute”
# “ itʼs a good idea to put the reasons why youʼve disabled steps in comments”
Enter Find Mode
End If

#7. Double-click layout tools to “lock” their use, and control-click fields to set defaults
Doing layout work is often just busy work.You’ll end up moving things by a pixel here, adding a field there, etc. It’s a pain to
have to constantly be formatting fields and juggling tools with your mouse. These shortcuts should help:
• If you double-click any layout tool, your selected tool will remain that which you double-clicked. For example, if
you have multiple text labels to place on a layout, simple double-click the “A” text tool.
• You can also control-click any field on your layout to make that the default style for all new fields you add to a
given database.

#8. Quickly sort records without the Sort dialog


Save time on sorting.
• Right-click (PC) or control-click (Mac)
on the field to sort by a field from its
contextual popup menu. There’s no need
to open the Sort dialog or try to figure out
what a given field is named.
21 Secrets of FileMaker Pro

9 SECRETS FOR INTERMEDIATE FILEMAKER PRO USERS

# 1. Use globals to avoid “embedded” text in your scripts and dialogs.


Global fields are a great way to store common values in your database and allow you to abstract certain
elements from your code. Instead of having to dig through scripts or layouts to find the places where you, say, misspelled
“Transactions,” you might opt to put such text into a global field so that you need only change it in one place.
• Create global fields for your custom dialog text and script messages so that making changes is a simple process of
changing data in a field rather than having to go back and dig through ScriptMaker™. This is a real boon when your
solution might need to accommodate multiple languages or be localized.
• Also use globals for button labels, navigation elements, and if you have time even field labels.

#2. Use FileMaker Developer’s debugging tool.


Bugs and testing are an integral part of writing software. If you have a copy of FileMaker Developer, be sure to use the
debugging tool. It will take you a great deal of trial-and-error or littering your scripts with Message alerts.
• It’s often a surprise to us how few people use this. The script debugger can help you quickly trace problems with
scripts, but it can also help simply identify which script is attached to a given button. Turn on Debugger and click the
button in question! (No need to go into layout mode and view button’s script assignment).
• It’s also a great tool for stepping through a script to identify problems. As a refresher, here’s the debugger:
21 Secrets of FileMaker Pro

#3. Move or copy data for performance improvements.


In FileMaker Pro it’s often possible to achieve the same results in a variety of different ways. There are times, though,
when one approach is clearly better than the others due to performance, clarity, etc.
• When working with large data sets, it’s often entirely possible to use Sum() functions on related records, or to use
Summary fields, but often a consequence will be slow performance, especially over a network. Use lookups or
scripted import/export routines to move the data into a “flat” indexable set of fields – or often into a reporting
database of their own – for searching, sorting, summaries, etc.

#4. Use XML to maintain column names.


Exporting data in CSV or TAB delimited formats is fine, but you’ll notice that column headers don’t come with them. To
make an export file useful, take a look at XML.
• Save data backups as XML: when importing, you’ll be able to make use of the very handy ‘Matching Names’ option
to establish field mapping, or at least will be able to share with another person what your column names are.

#5. Export summarized fields to sweep duplicate data.


De-duping databases can be a pain, and often involves scripts that you end up never using again. For a quick shortcut, try
this:
• Export summarized fields to filter out duplicate data values that you may then re-import. This is a quick way to de-
dupe a data set that you’re migrating or cleaning. Just be careful to make a backup of your source data first!

#6. Keep your files isolated and don’t forget proper copying rules.
Even given how simple FileMaker Pro’s best practices for deployment are, we’re never surprised when we discover
problems with files that have been improperly closed or copied. Learn these simple habits, and you’ll not have to worry
about file corruption. Never copy files while they are open (including zipping/stuffing). This is especially true for files on
FileMaker Server. Under no circumstances should you have sharing turned on for the FileMaker Server folder, nor should
you ever copy files while they are being hosted. This will lead to possible corruption.
• As you develop or deploy on FileMaker Server, be sure to archive and backup your files. Be sure to burn them
to CDs or compress them (zip, sit, etc.) and remove the actual .fp5 files from your network. FileMaker Pro file
references can get tangled if you have multiple copies of your solution sitting on your local computer.
If your files crash as you’re developing, always go to a backup.You’ll lose a bit of work that you might otherwise be able
to recover, but be conservative and make sure your files are in perfect shape.
21 Secrets of FileMaker Pro

#7. Use “open minimized/hidden” to avoid window flashing.


FileMaker Pro uses multiple files to store data, and as such many of your solutions can grow to using dozens of
files. While perfectly usable, their windows will flash when opening a solution that tends to be a distraction.
• This is more an issue with Windows-based solutions than Mac based, but users on both platforms will
appreciate it if you open files as Minimized or Hidden to reduce screen flashing when your application
starts up. Use explicit navigation scripts to move between files that then Maximize or Zoom your windows.
21 Secrets of FileMaker Pro

# 8. Use underscores in your naming conventions.


Remember that FileMaker Pro lives in a universe of data exchange. Keep in mind some of the limitations out there
beyond your favorite development tool.
• Don’t leave spaces in field names, relationship names, or layout names to support web based applications and
ODBC connectivity. Use an underscore instead. This will save Web developers from having to specially encode
spaces in the names of various elements if you ever choose to deploy a solution to the Web.

#9. Use housekeeping fields.


Keeping well organized as a developer is important – by using good programming habits – but you can also keep your
data itself well organized by tracking what might be considered “meta data” for each record.
• They add very little overhead to your files, and can dramatically help control exporting, importing, data migration,
and tracking down problems with certain users. Always create housekeeping fields in each file with appropriate auto-
entry functions:
o rec_Created_By
o rec_Created_Date
o rec_Created_Time
o rec_Modified_By
o rec_Modified_Date
o rec_Modified_Time

4 SECRETS FOR ADVANCED FILEMAKER PRO 6 USERS

#1. Use Multi-Key relationships


Multi-keys are a great technique you can use for a variety of purposes, not the least of which is cutting down on the
number of many-to-many join files your solutions require. First come to understand the mechanics of how they work,
then try using them for a few of our suggestions here.
• Use multi-keys when you want to create dynamic filtering or simply want to avoid building a join table.
o Values must be separated by a carriage return.
o Values can be entered into a standard text field, or a calculated text field.
o Here’s an example of a multi-line key, used for portal ‘filtering’ where a user adds data into a filter field and
the relationship displays appropriate match records.
• Use a relationship like “Contacts.Multi_Contact_Filter” (a relationship to a multi-line key in
contacts) The multi line key is calculated and looks like this:
21 Secrets of FileMaker Pro

If the contact’s name is “Agent Smith” their multi-key will look like this:
21 Secrets of FileMaker Pro

• You can then use a global field on the left side of the relationship to form a match. If the user types ‘a’
into the global, then any contact name that starts with ‘a’ will appear in our portal. If they type ‘agent’, then
matching records must begin with ‘agent’; if they type ‘agent smith’ then only contacts with that name will
appear in the portal. FileMaker Pro matches the related record on any line of the multi-key. Records that
match more than once will only appear in the portal once. Note also that we included a value that will let us
match all contact records ‘-All-‘.

#2. Use Compound keys


Another advanced trick with relationship keys comes in combining two that then represents the unique instance of that
combination. The ID from, say, “Bob Smith” and the key from “Acme Company” would look like “22_44” which in data
terms tells us that Bob is associated with Acme.You can then test logical assumptions against that pairing or perform
functions specific to it.
• Compound keys are good for restricting relationship matches to multiple criteria or keys. Compound keys typically
consist of two or more concatenated values (often from other fields, but literal values are also used sometimes).
One common use of compound keys is to establish the uniqueness of a record that joins two other tables.
o Consider a typical scenario of Contact, Organizations, and Members. The Members table will typically have
foreign keys for both of the other tables:
• Key_F_ID_Contact
• Key_F_ID_Organization
o A compound key that consists of values from the two foreign key fields might be called ‘Key_C_Contact_
Org’ (the ‘C’ notation let’s us know at a glance what kind of key this is). The calculation formula would look
like this:
• Key_F_ID_Contact & ”_” & Key_F_ID_Org
• Note that you must use a word separator between the two values in order for the compound
key to work correctly. Running the values together with no word separator will yield unpredictable
results.
o If you wish to use the above compound key to establish uniqueness of a join record, and perhaps allow a
contact to have only one join record to an organization, you can create a self join on the compound key,
and either validate records against that self join, or check for the number of records returned from the
relationship in a script.
o Compound keys are also useful when one of the values on the left side of the relationship is editable.
Consider a left hand matching field to the above key that uses a global field for the org key:
• Key_Comp_Contact_gOrg
o If you were to create a key like this in the contacts table, you would reference the primary key for the
contact, and then use a global field for the org key. This would allow us to match a specific join record (org
memberships) for the current contact, the global org value might be editable by the end user, or perhaps we
would insert the value from a more elaborate interface mechanism.
o Compound keys may also be used by multi-line keys. In other words, we might have a multi-line key that
is actually several lines of compound keys. This technique can be used to form complex array-like joins
between records.
21 Secrets of FileMaker Pro

#3. Avoid the Status Area frame in Instant Web Publishing


When using Instant Web Publishing, you’ll always get its version of the status area on the left in its own frame. There’s an
easy way to avoid it:
• Create a startup script for your files with a “Toggle Status Area” step to hide. IWP will simply provide the layout
in question without your status area.

#4. Reset primary keys to refresh relationships


One last easy trick: some relationship-based screen elements won’t automatically change when the referenced
relationship changes (a highlight color in a container field, for example.) Instead of writing various script steps (switch to
preview mode, then back again to browse mode is one approach), there’s a simple one-step solution:
• By using a script step to set a primary key to itself, you force FileMaker Pro to resolve all of the relationships that use
that key again. This is handy for getting relationship-driven data to refresh on screen when a user has set different
elements.
o Set Field[‘Key_P_ID_Contact’, Key_P_ID_Contact]
• Resetting any value in a record to itself is also a way for record modification auto entry values to refresh.

By Scott Love and Roger Jacques of the Moyer Group - www.moyergroup.com


December 2003

© 2003 FileMaker, Inc. All Rights Reserved. FileMaker is a trademark of FileMaker, Inc., registered in the U.S. and other countries.
ScriptMaker and the file folder logo are trademarks of FileMaker, Inc. Mac is a trademark of Apple Computer, Inc. registered in
the U.S. and other countries. The “Built for Mac OS X” logo is a trademark of Apple Computer, Inc. used under license. Microsoft,
Windows, and the Windows logo are registered trademarks of Microsoft Corporation in the United States and other countries. All
other Trademarks are the property of their respective owners. All persons and companies listed in examples are purely fictitious
and any resemblance to existing persons and companies is purely coincidental. Product features and specifications are subject to
change without notice.

You might also like