My.ADVISOR.com Sign-In
Username
Password
Sign Up 
Go to Article
Advanced Search 

Automate Navigation with FileMaker Pro Open Scripts

Help users see the correct information when they first open your FileMaker Pro solution.

By Paul T. Mitchell, Soliant Consulting technical manager

UNLOCKED -- This article is provided to subscribers of FILEMAKER PRO BASICS ADVISOR or DATABASED ADVISOR or FILEMAKER PRO BASICS ADVISOR. To subscribe or renew, go to Advisor Store.

Many FileMaker Pro solutions serve the needs of various levels of workers in an organization. The data entry clerks value efficiency, so they want to be able to open the solution and get right to where they need to go to do their jobs. The management most likely wants to see the information in the database sliced and diced in a different way, and may never need to see the data entry screens. When different categories of users need to access your database for different purposes, how can you help them efficiently get to where they need to go?

Figure 1: Create accounts -- For this example, you'll need accounts like these set up in your "Manage Accounts and Privileges" window.


Figure 2: An example of a possible opening script -- This script detects which Account is being used, and navigates to the proper layout and found set on that basis.


Figure 3: "File Options" dialog -- Notice that under "When opening this file," you see "Perform Script" selected, and that under "When closing this file," "Perform script" is again selected.

You designate any script to run upon the opening or closing (or both!) of a file, which you can do with just a few mouse-clicks. Okay, really, you need two things: Accounts and an opener script that checks those accounts upon login.


You can use the technique described in the article on any of your own files, but I've created specific exercise for you in an example file. Subscribers can download it to see how open and close scripts work.

Let's use an invoice database as an example. Your co-workers use this database to create and send invoices, and the bosses use it to view a list of the invoices. You'd like to have the workers, when they open the file, immediately see a new blank invoice ready for data entry. But you'd also like the bosses, when they open the file, to see a complete list of all the invoices created. How will you serve both types of user? You'll set up a script to run upon file open, of course!

First, you'll need separate accounts for bosses and workers (figure 1). To set up these accounts, go to the "Manage Accounts and Privileges" dialog. For this example, just call the two types of account "Boss" and "Worker." (For more information about setting up accounts, see Maria Langer's article, "Secure Your FileMaker Pro Databases.")

Second, set the script to run when anyone opens the file (figure 2). For simplicity's sake, name the script "Opener." It might look something like this code:

If [Get ( AccountName ) = "Boss"]
  Go to Layout ["List" (Invoice)]
  Show All Records
  Adjust Window [Resize to Fit]
Else If [Get ( AccountName ) = "Worker"]
  Go to Layout ["Entry" (Invoice)]
  Adjust Window Resize to Fit]
  Show All Records
  Show Omitted Only
  New Record/Request
End If

Finally, set your "Opener" script to run whenever anyone opens the file. You do this in the File Options dialog, which is under the File menu (figure 3).

This dialog, with just a few checkboxes, lets you specify a default Account and Password for the user to sign in on, a default initial layout to display, and which scripts to run upon the opening and closing of the file. In this example, however, do not select "Log in using" unless users are comfortable with bypassing the auto login.

In this example, when a manager opens the file using the "Boss" account, he'll see a list of all invoices in the database. But when a non-manager opens the file using the "Worker" account, he'll see only a single blank invoice, ready to fill in.

Automate Navigation with Open Scripts

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.

    Paul Mitchell has eight years of experience working with FileMaker Pro, including nearly four years with the FileMaker, Inc., Technical Support team and almost four years as an in-house developer for a printer of retail signage. Before FileMaker Pro, he served in the U.S. Air Force, and held jobs in a variety of industries. Today, he's a technical manager at Soliant Consulting.

    Printer-friendly
    page layout

    Keyword Tags: FileMaker, FileMaker FileMaker Pro, FileMaker Users

    ADVISORAMA
    Those who are victorious plan effectively and change decisively. They are like a great river that maintains its course but adjusts its flow. They are skilled in both planning and adapting, and need not fear the result of a thousand battles, for they win in advance, defeating those that have already lost.
    -- Sun Tzu, Chinese warrior, 100BC

    ARTICLE INFO

    FileMaker Pro Basics Advisor

    Web Edition: 2008 Week 08, Doc #19383

    Print Edition: Issue #13, Page 8

    SUBSCRIBER ONLY ARTICLE LOCKED

    New Publication for FileMaker Users

    ADVISOR BASICS
    of FILEMAKER PRO

    Get fast, easy help on using FileMaker Pro database software. Learn the basics, follow the steps, enjoy the results!

    Act now to get the special Charter Subscriber offer.

    Read the fast-track to learning and using FileMaker Pro

    Subscribe to FileMaker Advisor Magazine

    Read the advanced guide to creating custom business database solutions with FileMaker software. Subscribe now to gain access to all the archives and downloads.

    FileMaker.Advisor.com

    Subscribe to Advisor Basics of FileMaker Pro

    Learn the fundamentals of using FileMaker Pro software. Every issue gives you step-by-step instructions on creating the databases you need. Subscribe now!

    FileMaker.AdvisorBasics.com

    Free E-Newsletters

    Keep up! Hot News, How-To, Tips & Tricks, Expert Advice, and more. Click to request your's free.

    AdvisorUpdate.info

    Need Know-How Now?

    What direction are you going with your business? Advisor Guides are packed with the answers you need to work smarter. Can you afford to fall behind?

    AdvisorStore.com

    Showcase Your Smarts

    Submit your tips, techniques and advice and let Advisor promote your business and build your career. Show the world what you know!

    AdvisorTips.com

    Use of this or any other site, content, product or service of Advisor Media constitutes acceptance of Terms of Use.
    Portions copyright ©1983-2008 Advisor Media, Inc. 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, Inc. 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.
    mitcp008 posted 02/18/2008 modified 05/12/2008 03:43:42 AM ztfmfu/ztfmfu
    domino-144.advisor.com my.advisor.com 05/16/2008 12:29:13 PM