Move Portal Row Data Via Variables

From Dwayne Wright PMP - Certified FileMaker Developer
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

This example is designed to show you one method of moving portal row data from one portal to a different portal. I think this is the third or fourth version of the example that I've done over the years. This is because every update to FileMaker brings us a new set of tools that prompt the FileMaker developer to improve their design. In this case, my previous example of moving portal row data involved 3 files, a half dozen scripts and a half dozen relationships.

Now the example is one file (with three tables), 3 relationships and one script. I'm using script variables and lookups to do most of the heavy lifting. This example uses the idea that you are trying to manage the manning of the concession stand at high school games. You have a list of possible parents to pick for each game and you pick the parents that are going to attend.

The script basically copies the key id data that you are going to use into script variables, goes to the table you are going to create the new record with and pasting in the key data. Very simple and not overly heavy at all. 

You have two choice of a local variable and a global variable. Each has it’s own unique advantages and drawbacks. I’d have to say the local variable is probably more commonly used simply because FileMaker will define a variable as local by default.

A local variable is defined by adding a single dollar sign in its name such as $InvoiceNumber, $ClientID or $Counter. A local variable will store it’s information within a script while that script is running. After the script is finished in it’s execution, the defined local variable will have no value. An advantage of this is like a disposable lighter. When you are done, you throw it away because you never intend to refill it.

A global variable is defined by adding a two dollar sign characters in it’s name such as $$InvoiceRange, $$Array or $$UserPrefs. A global variable will store it’s information within the entire file while the file is open. This way it can be used across scripts or even in-between times that scripts are called upon.

An example file can be downloaded by clicking (here)

© 2010 - Dwayne Wright -

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.