My.ADVISOR.com Sign-In
ID
Password

Member Center / Sign-Up
Go to Article
Advanced Search 

ADVISOR ANSWERS

Normalize FileMaker Pro Contact Data

Find out what to do if you want to print mailing labels for each contact in a customer record, but all the contacts are listed under one customer name.

By Chris Moyer, The Moyer Group CEO and FileMaker Advisor technical editor, and Bob Bowers, Soliant Consulting CEO and FileMaker Advisor technical editor


Q: I'd like to print mailing labels for each contact within a customer record. Is there a way to do that even though all the contacts are listed under one customer name? I'm using FileMaker Pro 7.0v3.

A: The way you've structured your database tables -- with multiple fields for contact names within a customer record -- may work well for entering data, but as you've discovered, it makes it difficult to do even simple searching and reporting. Your data exists right now in one big "flat file." Each record in the table represents a customer, and you have five fields in which users can enter the names of contact people at that company.

The problems with a data model rarely reveal themselves as you set up your layouts and enter data. Indeed, it's easy to put those five contact fields on the customer layout and let users enter what they need. But what will they do if they have to enter more than five names for a given customer? That's the first issue with your data model -- it isn't extensible. Your database is imposing an arbitrary restriction on the number of contacts you can associate with a customer, and there probably isn't a business rule that requires such a restriction. You can, of course, add more fields and skirt any immediate problem, but you've merely raised the ceiling, you haven't eliminated it.

Another limitation will become evident the first time you want to search for a contact person. Say you have Mary Jones on the phone and need to look up the customer record of her employer. So you enter Find mode, and type "Mary Jones" … hmm, where? She might have been entered as Contact 1, or she may have been entered as Contact 3. You'll have to search all the contact fields. Yes, you can come up with a nifty script that searches them all, or concatenate all the contact names together and search the result, but those are merely work-arounds to make up for a deficiency in your data model.

Suppose for each contact you also have a checkbox that indicates whether the person is active or inactive. Your boss comes to you and asks you to print a list of all the active contacts. Or, maybe she wants something as simple as, say, mailing labels so you can send them all a new product announcement. As long as all the contacts are co-mingled with the customer record itself, you won't be able to find any subset of contacts, much less print them as a list or on mailing labels.

A more appropriate way to structure the data would be to have separate tables for Customer and Contact data. Assuming your customers all have unique IDs assigned to them (a primary key), you can then link Customers to Contacts in a one-to-many relationship simply by having a field in the Contact table where you store the ID of the Customer they're associated with (a foreign key). All the issues we described above disappear immediately: You can associate an unlimited number of contacts with a contact; there's no ambiguity as to where to perform a search; and finding and printing contacts is trivial.

"All fine and dandy," you say, "If I were able to start over from scratch. But how can I fix -- or work around -- my current database?"

Any solution begins with setting up a Contact table as we described above and creating a relationship between Customer and Contact. Assuming you've done that, then it's just a matter of writing a script to move the existing contact data from Customer into Contact. There are several approaches that will work. We'll look here at two simplified methods; you'll get the concepts and can then modify as necessary to accommodate your solution.

What do YOU think about this topic? Share your advice and thoughts using this form.

Your Name

REQUIRED : PUBLIC

Your E-Mail

REQUIRED : PRIVATE

Job, Company

OPTIONAL : PUBLIC

City, State, Country

OPTIONAL : PUBLIC

Your Web Site

OPTIONAL : PUBLIC

Your Comment

Please help everyone by keeping your comments on-topic, using clean language, and not defaming or making personal attacks.


Your e-mail address is required, but it will not be displayed to the public or given to anyone. See our Privacy Policy. Comments become visible after they pass our spam filter, and spammers and abusers are permanently blocked. Please report spam or abuse.

Chris MoyerChris Moyer is president and CEO of The Moyer Group, a FileMaker Pro consulting and training firm with offices in Atlanta, Chicago, and San Francisco. Chris is a technical editor of FileMaker Advisor Magazine.

Robert BowersBob Bowers is CEO of Soliant Consulting, and co-author of three books on FileMaker Pro, including Special Edition Using FileMaker Pro 7. Bob is one of a handful of trainers authorized to teach the FileMaker Professional Foundation Training Series. Bob has been a speaker at several FileMaker Developer Conferences, and was awarded the FileMaker Fellowship Award in 2002.

Printer-friendly
page layout

Keyword Tags: FileMaker, FileMaker Development, FileMaker FileMaker Pro

ADVISORAMA
Either war is obsolete or men are.
-- R. Buckminster Fuller, 1966 (1895-1983)

ARTICLE INFO

FileMaker Advisor

Web Edition: 2008 Week 22, Doc #19455

Print Edition: June/July 2008, Page 4

FREE ACCESS FREE ACCESS

SUBSCRIPTION STATUS
You are not signed-in. If you are a subscriber to this publication, sign-in above to access locked articles. To subscribe or renew go to www.AdvisorStore.com.

Subscribe to FileMaker Advisor Magazine

Read the advanced guide to creating custom business database solutions with FileMaker software. Subscribe now to gain access to all the archives and downloads.

FileMaker.Advisor.com

Subscribe to Advisor Basics of FileMaker Pro

Learn the fundamentals of using FileMaker Pro software. Every issue gives you step-by-step instructions on creating the databases you need. Subscribe now!

FileMaker.AdvisorBasics.com

Showcase Your Smarts

Submit your tips, techniques and advice and let Advisor promote your business and build your career. Show the world what you know!

AdvisorTips.com

Use of this or any other site, content, product or service of Advisor Media constitutes acceptance of Terms of Use.
Portions copyright ©1983-2008 Advisor Media, Inc. All Rights Reserved.
Reuse or reproduction of any portion or quantity of Advisor Media's copyrighted content, in any form, for any purpose, requires written permission.
ADVISOR®, the ADVISOR logo, and other names and logos that incorporate ADVISOR are registered trademarks, trademarks or service marks of Advisor Media, Inc. in the United States and/or other countries.
Other trademarks are used for identification, editorial or descriptive purposes and are the property of their owners.
Hosted by Prominic.NET Website powered by
LOTUS SOFTWARE
moyec075-01 posted 05/26/2008 modified 12/01/2008 04:12:48 AM ztfmfd/ztfmfd
domino-144.advisor.com my.advisor.com 12/03/2008 04:13:10 PM