Modular Script Design In FileMaker

From Dwayne Wright PMP, PMI-ACP, CSM
Certified FileMaker Developer

WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

As many of you know, FileMaker solutions tend to consist of 2 or more individual tables that work together. Although you can have a worthwhile FileMaker tool that consists of only one table, a solution has considerably much more power in numbers.

You can have a script perform a different script. You can even have a script perform a script that is stored in a entirely different FileMaker file. This can make your solution much more powerful because multiple files can share script action to perform a task.

This can also be used to break down a very long and complicated script into smaller but linked subscripts. I've seen some scripts so long and complicated, it hurts the brain just to look at them. Breaking them down into subscripts may help keep your head straight when writing the script and really help when you have to troubleshoot a script.

Subscripts can also very helpful when you have one set of tasks that can be shared by many scripts. For example, let's say we have 3 things we want to do for new customers each month. The scripts could have names such as...

Mail Thank You To New Customers
Send Coupons To New Customers
Report On New Customers For The Month

In each of these scripts, we could have the Find operation or we could have one script that does the find... and all the others call that script as a sub-script!

The second option, “Send Coupons To New Customers”, you could have as a subscript in many scripts. Perhaps it can be called upon by scripts such as ...

Print Invoice (calls upon coupon subscript)
Customer Annual Inactivity Report (calls upon the coupon subscript)

Troubleshooting can be easier with multiple scripts calling upon each other in a modular fashion as well. Also if you are using FileMaker Advanced, you can copy script steps from one script to another. This means you can always consolidate your modular scripts into one larger script at a given time.

=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2007 - Dwayne Wright - dwaynewright.com

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.