Context Dependence & Independence

This was supposed to be posted in my FileMaker Term Of The Day blog last Saturday but somehow that didn’t happen. When it came up in my startup articles not posted search, decided to tweak this a little bit for The FileMaker Thought Bucket blog.

FileMaker relationship context can be one of the most challenging hurdles for a FileMaker developer starting out. In many cases, you can create a very good FileMaker database and skirt right past context issues. However, as your FileMaker database grows and evolves, relationship context will be an area in your design that you will need to deal with.

Layouts are linked to a defined table occurrence, so what you see on a layout is dependent upon the context of that table occurrences setup in the relationship graph. When defining a layout or a calculation, FileMaker needs a reference table point of reference and this is often called the context. However, FileMaker isn’t asking you for a table in these areas but a table occurrence. This is the object that shows up on a relationship graph and a table can have many table occurrences on the graph.

Calculations are linked to a defined table occurrence, so what you define within your calculation is dependent upon the context of its defined table occurrence. Across the top of the specify / manage calculation dialog box is a pull down menu (ignored more times than not) which is used to setup the relationship context for the calculation. The calculation context is basically the same as saying which source table occurrence you are going to use in the calculation and any related values used in the calculation will come based from this source.

Now ScriptMaker is more or less independent of context. You can be on a layout that is tied to a particular table occurrence and run a script that isn’t remotely associated with it. This can be very helpful and sometimes cause problems. It really depends upon how the script is structured. In most cases, you will want to run your script to be as independent of context as possible. This can be made a bit more easy for you to do if you comment your scripts heavily. This way you can foresee how the script is designed to run, without having to actually run it.

Here are some links to other posts that might be of interest in regards to this topic...
More About Layout Context And Table Occurrences
More About Calculation Context And Table Occurrences
Layout Context