Search Project Mgmt
Search FileMaker Blogs
FileMaker Blog
Friday
Aug312007

FILEMAKER: Go To Record / Request / Page Script Step

From Dwayne Wright - www.dwaynewright.com

Go To Record / Request / Page is one of the few commands that does something a little different based upon the mode that you are in. In Browse mode, it will go to a defined record in the FOUND SET (sorry for the all caps, but that found set part is important to remember). The next two options are not used that often but can add to some very interesting scripts. In Find mode, it will go to one of your Find Requests (can’t say that I’ve ever seen this in a script). In Preview mode, it goes to a print preview page.

Via the options pull down menu, you can go to the first, last, next, previous or by calculated value. First will go to the first record in the found set, the first find request or the first page to print. Last will go to the last record in the found set, the last find request or the last page to print. Next will go to the next record in the found set, the next find request or the next page to print. Previous will go to the previous record in the found set, the previous find request or the previous page to print.

The go to record next and go to record previous also have the option to exit after the last. This is used so you can easily exit out of a loop operation that is going from record to record.

The calculation option is used to add an almost unlimited flexibility to scripted navigation. One example is to go to a random record. Recently, I’ve been posting a FileMaker term each day to my Term Of The Day blog. Most of these terms I’ve written over the years in my guides and new terms come to light all the time. I have just over 500 terms currently. In my “Pick A Term” script, it does a find for terms I haven’t posted to the blog yet. Then does a Go To Record script step via the calculation of the Random function times the number of records in the found set. That way, I get a random term to publish every day!

HOW IT IS USED
The Go To Record script step can be used in dozens of different ways. It is commonly used when the designer hides the FileMaker status area from the user. The user cannot navigate record to record by using the flip book. This requires a designed set of buttons to navigate through records. The designer may decide to put background script steps along with the Go To Record steps.

The Go To Record step is also commonly used in looping script operations.
FileMaker will perform a set of tasks on one record, go to the next record and perform those steps again (exiting the loop on the last record).

COOL IMPLEMENTATIONS OF IT
I built a FileMaker solution that audited any change in a number of key fields whenever the navigational buttons were clicked. This background auditing was done on a record by record basis whenever the Go To Record buttons were clicked on.
Got To Know Factor - 6

=
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.

Tuesday
Aug212007

FILEMAKER: The Go To Layout Script Step

From Dwayne Wright - www.dwaynewright.com

This script step will take you to a layout in the current window / file.

You cannot go to a layout in another window unless to go to that window first. Also, you cannot have a GO TO LAYOUT step for a layout in an outside file. A way around this is to have your script, call an external subscript in another file, which in turn would have the GO TO LAYOUT step.

You also can specify a layout by it’s number in the layout order list. This is done by using a calculated value specified in the options of the Go To Layout script step. If you reorder your layouts however, this script could take you to the wrong layout.

You also can specify a layout by it’s name. This is done by using a calculated value specified in the options of the Go To Layout script step. If you rename your layouts (or don’t use unique layout names however, this script could take you to the wrong layout.

You also have the option to take the user back to the original layout. This is used in a script that has 2 or more Go To Layout script steps in it, to take the user back to the original layout when the script was first called upon.

There are times when you need to take ScriptMaker to a particular layout so that it can perform a set of script steps. For example, to use the GO TO PORTAL ROW script step, the portal needs to be on a layout it can be found on when that step is executed. If not, FileMaker simply passes over that step.

COOL IMPLEMENTATIONS OF IT
One of the most simple but yet very cool implementations I've seen is to go to a developers layout in a script. What you do is create one layout in all files that has all the fields and possible portals you use in the file. Then you always go to this layout when executing complex scripts and then use the Go To Layout (original layout) when you are done without any error notification to the user.

Another very cool implementation is going to layout by a calculation. That means you can react to any calculated result before going to that layout. I have a solution that allows a user to determine if they like to go to form view or list view when they go to a different module (such as going from contacts to invoices). I use the Go To Layout (calculated) to go to the layout that user prefers to end up on!

FYI...
It's not enough to take the user to the correct layout/screen. Always make sure they are in the right mode (Browse - Find - Preview).

Got To Know Factor - 8

Here you can see the options for the Go To Layout script step. You can go to a specific layout, a layout in the layout order as defined by a calculated value, go to a layout name by a calculated value or an original layout ( used when you a previous Go To Layout step and you want to go back to where you started).

=
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.

Saturday
Aug182007

FILEMAKER: Navigation Steps Listed

The second family of FileMaker script steps are the Navigation Script Steps. Most of the script steps here are used to navigate to a layout, record, field, portal row or mode (other than the layout mode).

Go To Layout
Go To Record / Request / Page
Go To Related Record
Go To Portal Row
Go To Object
Go To Field
Go To Next Field
Go To Previous Field
Enter Browse Mode
Enter Find Mode
Enter Preview Mode

Monday
Jul302007

FILEMAKER: Potential Issue: Script Steps That Need To Enter Into A Field

From Dwayne Wright - www.dwaynewright.com

There are also a number of script steps that need to enter into a field on the
current layout to perform. So in your script, you have to make sure you have a Go To Layout script step to insure that the needed field is there. So more than likely, your script will look something like this ...

Freeze Window (prevents screen flash going between two layouts)
Go To Layout (that you know has the field you need)
Do That Thing (one of the dependent steps mentioned below)
Any Other Steps You Want To Do While You Are Here
Go To Layout (goes back to the original layout

The following script steps (and this list may grow as new versions of FileMaker come out) need to see the field they are working with ...

Copy, Cut, Clear, Go To Field, Insert Calculated Result, Insert Date, Insert Time, Insert User Name, Paste and Replace.

Also the script step of Relookup needs to be able to enter into the parent key field of a relationship to perform the relookup operation.

Generally, you don’t get any kind of error from FileMaker when this happens ( unless you are trapping for it ). So this can be a hard bug to troubleshoot.

=
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.

Sunday
Jul292007

FILEMAKER: The Set Error Capture Script Step

From Dwayne Wright PMP
Certified FileMaker Developer

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

Please Note: If you are viewing this page in a news feeder, the images may get munged up a bit or other formatting of the posting may fail. For the best experience, please visit the journal directly by clicking (here).

We all have had the experience of encountering a FileMaker error message. The most common occurrence is when FileMaker tells you that it didn't find any records that match your settings in a find command. Which isn't so much an error as a condition message from FileMaker.

Some of the messages you get from FileMaker after an error might be confusing, particularly to the users that are not familiar with FileMaker. In particular, FileMakers default error message system does not know in what context the developer wrote the script. So it has no way to best customize the error message to make the best sense in the business logic used. That is where the developer can step in and lend a hand.

In the Control family of script steps, the Set Error Capture step is the fundamental first step that allows ScriptMaker to detect errors in advance and instead of showing a FileMaker error message ... allows the developer run a set of script steps.

When Set Error Capture script step is included in a script and is set to the ON position, the FileMaker pop up error dialog boxes to the user are suppressed while the script is running. You then can use the IF, ELSE and END IF scripts steps are part of your error handling routine.

You can do a number of things when an error is detected such as return your own error message elaborating on the condition, run a set of subscripts that may resolve the problem and/or log the error condition for later illumination.

HOW IT IS USED
FileMaker, like almost any application, will give you an error message when an error occurs. Usually, this is a good thing and you can then go on about your business. Sometimes though, you would rather have the database react in a customized manner when a common error occurs. Usually the Set Error Capture step is used in conjunction with an IF Statement. If a particular error comes up, immediately perform a desired task. There are a number of reasons you want to do this but they usually fall into the two main categories of the user experience and automating processes.

The user experience is when you don't want to confuse a database user with a FileMaker error dialog message they might not won't understand. I’m not saying the FileMaker error messages are not top drawer ( because they are ). However, you might have some very inexperience users and messages about the found set might not make sense to them. Using error capture in your scripts gives the developer the opportunity to either rephrase the error message and even even create a set of script steps to resolve the error.

Automating processes is usually for tasks that run at midnight or without the direct over the shoulder attention of a database user. This allows the script to keep running or branch in another direction when these errors occur. If you didn't have this step, FileMaker would basically be suspended until someone cleared the default FileMaker error message from the screen.

COOL IMPLEMENTATIONS OF IT
The FileMaker error message of "No Records Found" can toss a lot of beginning FileMaker users for a loop. If you trap for this error, you can control what the user can do after a search comes up fruitless.

FYI...
You should always try to put this script step as close as possible to the top. It will not affect script steps that are above it in the script.

Got To Know Factor - 8

=
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.

Page 1 ... 11 12 13 14 15