BackMagic

Separation Model

What is "the Separation Model"

While this term can mean a lot of things, we're using it here to refer to any number of architectures where there is an interface file separate from the data file(s). In such a system, if you were on the form view of a contact's record, for example, the contact's table would be defined in a separate file (a separate .fp7) from the file your layout is in. You've "separated" some of the data from the interface.

Using BackMagic with the Separation Model.

BackMagic (BM) works in separation model systems just as it does in traditional FileMaker designs, you just set it up slightly differently.

To begin with you don't need to add BM's custom functions, calc or script to your data file(s), just to your interface file(s).

When it comes to adding the unstored calcs, zz.BackMagic.cr, you'll add this to one of the tables in your interface file. If you don't have a table in your interface file you'll need to create one for this purpose.

You'll also relate the interface-file's-table to each of the table occurrences on which your layouts are based. Here is an example:

The graph below is from our interface file. The table occurrences for Contacts and ContactTasks represent tables in our data file. Our contact and task layouts are both in our interface file.
In this situation, we'll define our unstored calc in the interface file along with our custom functions and Back script. Then, when we place the Back controllers on our Contacts layout, we'll use select the field from the ContactsInterface table occurrence. When we add BM's field to the ContactTasks layout, we'll select the field from the ContactTasksInterface table occurrence. We'll do this instead of selecting them from the "Current Table" as indicated in step 6 of Add BM to Your File.
(Notice how we're using cartesian joins (the "X" operator in the relationship) to join our data table occurrences with our interface table occurrences.)

More Separation: Multiple Interface Files

If you're using more than one interface file, you should know that one of BM's limitations is that it maintains one back stack per file (per .fp7). But if you're using multiple interface files, you probably figured that out by now. =)

(855) SEEDCODE
[email protected]
Follow us: