Jump to content
Server Maintenance This Week. ×

Calculated Fields - Good Practices


This topic is 5305 days old. Please don't post here. Open a new topic instead.

Recommended Posts

This is question for all the FM gurus on design theory. I'm sure this has been addressed elsewhere before but here goes.

Lets say you have a simple table of contacts. In that table you have three fields for phone numbers:

1. Home Phone

2. Work Phone

3. Mobile Phone

Right now I know a bunch of you are diving for your keyboards about to write that there should be a related table with two fields; one for the number and one for the type. Yeah I know but lets just put that idea on the back burner because this is just an example, not reality.

As a good FM developer you want to provide your users with an easy way of searching for a phone number. The general plan is to put a global field at the top of the layout and a search button next to it. Obviously the user would enter a number and it would return all records where either the home phone, work phone, or mobile number matches.

Now I see two ways to skin-the-cat:

1. Create a new (calculated) field that concatenates the three numbers and then have a script search that field.

2. Create a single script that searches all three fields.

Now I would tend to go with option 2 and here is my reasoning. System resources (CPU / memory) are needed to produce the content in a calculated field. This is often fine because some calculated data must be available whenever the system is in use. However, in other applications calculated content is unnecessary much of the time. For instance, in the example above the only time the concatenated phone numbers are truly necessary is when a user is searching for a phone number. Since searching for phone numbers is probably pretty rare this means that perhaps 99% + of the time the calculation engine is producing content which is unnecessary. This would seem to be a waste of the computer's resources to me which is why I choose option 2. I'd rather hit the the system harder for a few seconds a day while the user searches than burden it with continually producing content for all X number contact records.

I don't know the internal workings of Filemaker so I may be all wet. Other opinions?

Link to comment
Share on other sites

This topic is 5305 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.