My.ADVISOR.com Sign-In
ID
Password

Member Center / Sign-Up
   
SUBSCRIPTION STATUS
If you are a subscriber to this publication, sign-in to access locked articles. To subscribe or renew go to www.AdvisorStore.com.
Go to Article

ADVISOR ANSWERS

Polish FileMaker Pro Solutions with Scripting

Want to spiff up a solution? Scripting is the answer. Find out how scripting can help your solutions look great.

By Lee Lukehart, Soliant Consulting director of training


Q: I recently inherited the responsibility for a shared FileMaker Pro 8 database used by six others in my company's customer service department. My co-workers are hinting that they'd like to have a little more "polish" put on our system, specifically in automating our reporting process. I suspect the answer lies in better scripting, but there are so many script functions and I'm not sure where to start. I'm comfortable editing layouts, defining buttons, and writing simple scripts. Can you provide any pointers, please, to make generating reports a little slicker?

A: Your intuition is right on the money. Scripting in FileMaker Pro lets you automate workflow, interact with the user, and create responses based on that input and other conditions, such as current date, number of records found, or identity of the logged in user. For a detailed look at scripting in action, see Paul Mitchell's article, "Automate Navigation with FileMaker Pro Open Scripts." You've already done some scripting, so you know the basic premise is quite straightforward: open ScriptMaker from the Scripts menu, create a script, and add a series of script steps that achieves the desired outcome. Ah, but which steps to use, and how to best apply them? With more than 130 script steps to choose from, there's the rub, as Shakespeare's Hamlet would say. Additionally, many script steps can directly access the specify calculation dialog -- providing a powerful synergy that creates infinite options to craft the outcome you seek. I'll suggest a few script steps that are popular hard workers, and demonstrate how they can work well together.

One way you might automate and polish your co-worker's reporting workflow is to intelligently guess the dates for the report. Let's say every week each of your co-workers runs a month-to-date report of customer service requests they've received, summarized by category. To select the records for their report, they currently must do a manual find on two fields: RecordCreatedDate, the date the customer service request was created, and RecordCreatedBy, containing the FileMaker Pro file login (account name) of the employee who took the request. Then they click a button on your report menu that prints the report. You want to revise that behavior to automate the find, but also let the user customize the date range before running the report. Also, you don't want running the report to disturb the current found set of records. For a little added functionality, you'll even let the user customize the report title that prints at the top of the report.

To get a clear idea of the process you'll need to create, it's useful before opening ScriptMaker to write out the sequence of steps in general terms -- sometimes called pseudocode. A script for the proposed scenario might proceed as follows:

User starts script from a button or the Scripts menu.
1. Present a Custom Dialog with OK and Cancel buttons, and three pre-filled entry fields:
- Start Date (first day of the current month, or last month if today is the 1st)
- End Date (yesterday's date)
- Report Name ("MTD Customer Service Summary")
2. If user clicks on Cancel, end the script. If user clicks on OK, Open a New Window (so user's current window remains undisturbed).
3. Go the layout for the desired report.
4. Find current user's records within date range from the Custom Dialog.
5. Sort as needed.
6. Preview the report.

To accomplish this workflow, the script steps you'll want to use, among others, are:

Show Custom Dialog
If / End If
Enter Find Mode
Set Field
Perform Find

You'll also need three global fields -- two of field type Date and the third as type Text -- to hold the search start and end dates and custom report name entered via the Custom Dialog. Regular fields would work, but the advantage of global fields is that you can temporarily store data without concern about which record you're on or move to.

TIP
If you haven't used a global field before, just think of it as a regular FileMaker Pro field (text, number, date, time, timestamp, or container) whose content is shared by all records. If the value of a global field changes in one record, that value is immediately available to all other records. In fact, the content of a global field is available to any record in any table in your file -- even unrelated tables -- and it can also be shared across files if at least one relationship exists between them. You can make a field global when you're defining fields in the Define Database dialog (Manage Database in FileMaker Pro 9). Select the field name and click on its Options... button. Select the "Use global storage" checkbox under the Storage tab to make this a global field.

Lee Lukehart is director of training for Soliant Consulting, an FBA Platinum Member. Lee is a FileMaker authorized trainer, Developer Conference speaker, and FileMaker 7/8/9 Certified Developer -- and was juggling data even before he caught the FileMaker bug in 1986.

Printer-friendly
page layout

Polish Solutions with Scripting

No reader comments ... yet.

    What do YOU think about this topic? Share your advice and thoughts using this form.

    Your Name

    REQUIRED : PUBLIC

    Your E-Mail

    REQUIRED : PRIVATE

    Job, Company

    OPTIONAL : PUBLIC

    City, State, Country

    OPTIONAL : PUBLIC

    Your Web Site

    OPTIONAL : PUBLIC

    Your Comment

    Please help everyone by keeping your comments on-topic, using clean language, and not defaming or making personal attacks.


    Your e-mail address is required, but it will not be displayed to the public or given to anyone. See our Privacy Policy. Comments become visible after they pass our spam filter, and spammers and abusers are permanently blocked. Please report spam or abuse.

    ARTICLE INFO

    Web Edition: 2008 Week 09, Doc #19386

    FREE ACCESS FREE ACCESS

    Keyword Tags: CRM, FileMaker, FileMaker FileMaker Pro, FileMaker Users, Microsoft Windows, Training

    ADVISORAMA
    If there is an opportunity to make a mistake, sooner or later the mistake will be made.
    -- Edmund C. Berkeley

    Use of this or any other site, content, product or service of Advisor Media constitutes acceptance of Terms of Use.
    Portions copyright ©1983-2010 Advisor Media, LLC. All Rights Reserved.
    Reuse or reproduction of any portion or quantity of Advisor Media's copyrighted content, in any form, for any purpose, requires written permission.
    ADVISOR®, the ADVISOR logo, and other names and logos that incorporate ADVISOR are registered trademarks, trademarks or service marks of Advisor Media, LLC in the United States and/or other countries.
    Other trademarks are used for identification, editorial or descriptive purposes and are the property of their owners.
    Hosted by Prominic.NET Website powered by
    LOTUS SOFTWARE
    ztfmfu0803 lukel002-03 posted 2008-2-25 mod 03/15/2010 03:11:34 AM ztfmfu/
    domino-144.advisor.com my.advisor.com 03/21/2010 04:46:16 AM