Archive for April, 2008

Exclusive Checkboxes

Wednesday, April 30th, 2008

Problem: Provide the user with a choice of options, limited to only one selection and allow them to deselect a selection.

When selecting the control style for a field, you have the choice of radio buttons and check boxes. Both are based on a value list. A radio button set gives the user an exclusive choice – if they select an second choice, the first is turned off. A checkbox set gives the user the ability to select multiple items.

One problem users sometimes have with radio buttons is accidental selection. Perhaps you make a selection and you want to 'unmake' the selection. A radio button can be turned off if you hold down the Shift key - but most users don't know that. And it is not something you should have to teach. You can't use checkboxes because you want an exclusive choice – only one item selected.

So how can you combine the usefulness of an exclusive choice provided by radio buttons with the ability to turn them off provided by checkboxes? I'm glad you asked.

Firstly, use a checkbox for the control style. Then set the auto-enter options for the field. Choose to auto-enter a calculated value using the expression:

GetValue ( yourfield ; ValueCount ( yourfield ) )

If you are using FileMaker Pro 9 and want to apply this to a number of fields, you can take advantage of the new Self function. The following expression can be copied and pasted for any field:

GetValue ( Self ; ValueCount ( Self ) )

When exiting the field options dialog, make sure "Do not replace existing value of field (if any)" is unchecked.

Auto-entered calculation

Now when you use the checkbox, you will have an exclusive choice enforced like a radio button set. And you have the added advantage of being able to turn off a checked field.

If you don't want or need to know how it works, you can stop reading. If you are curious or just need to know, read on!

One of the keys to this technique is knowing how checkbox fields work behind the scenes. When you select multiple items, they are stored as a return-separated list in the order in which they were selected. So the last item selected is the last item in the field list. You can see this if you have two copies of a field on a layout – one using checkboxes, the other a plain edit box.

In our scenario, we don't want to allow multiple selections – when a user selects a second item from the checkbox list, you want only that item to be retained. The auto-entry calculation above returns only the last (most recently selected) value in the field. It does this with two functions.

The first is the GetValue function. The syntax is GetValue ( listOfValues ; valueNumber ). In the calculation, you are using the current field (or Self) to supply the listOfValues. You want the valueNumber to be the number of the last value in the field. The number of the last value is calculated with the ValueCount function – the number of values is the number of the last value!

In summary, the expression says "give me back only the last value in the field". And that works for you because the last value is the most recently selected value. If the last remaining value is deselected, the field is empty and remains so.

Challenge: This technique can be extended to allow a maximum number of values to be selected from a checkbox list. For example, select your three favourite colours from a list. When you select a fourth, the first selected will be removed.

Control the scroll (wheel)

Monday, April 21st, 2008

These days, many users use a mouse scroll wheel to get around screens quickly. It is much faster to use a scroll wheel than scroll bars to move up and down in a window. The support of the scroll wheel in FileMaker Pro 8 and above is described in the FileMaker KnowledgeBase Article 5439.

There are three commonly asked questions about using the mouse scroll wheel:

1. How can I use the scroll wheel to scroll through portal rows?
Click in the portal row (but not in a field). Hold the mouse cursor over the portal, then rotate the scroll wheel.

2. How can I use the scroll wheel to scroll through records in Form view on a Macintosh?
Move the mouse cursor over the book or slider in the status area, then rotate the scroll wheel.

3. How can I STOP the scroll wheel scrolling through records in Form view on Windows?
Hide and lock the status area. The record scrolling behaviour is not disabled unless that status area is locked.

Note that you can only lock the status area with a script step – Show/Hide Status Area. This script step provides three actions – Show, Hide and Toggle. There is a further option to specify Lock for any action.

The Show/Hide Status Area script step can either be assigned to a button or it can be part of a script. If you choose to lock the status area, be sure to duplicate any required status area functions and information on your layout. You can create buttons to scroll through records and switch between layouts. You can create calculations to display the current record number, found count, total record count and sort state.

Also be aware that if you close the status area, you will probably need to open it when in Preview mode during report printing. This gives the user access to the book icon to scroll between pages and also to the Continue button when paused in Preview mode. So open it when you need it, and close (and lock) it when you are finished.

Quick Delete

Tuesday, April 8th, 2008

Here is a shortcut that I used today when I was visiting a client. They were so amazed that I thought I would share it with you.

Usually, when you delete a record, FileMaker Pro displays a dialog asking if you are sure. The most important word here is PERMANENTLY. Once you click the Delete button, there is no way to get that record back. And I should know – I have wanted it back on more than one occasion!

FileMaker delete dialog

When you are deleting a lot of records, say from a list, the warning dialog can get very tedious. Delete. Yes, delete. Delete. Yes, delete. Delete. Yes, delete. Get the picture?

So here is the tip. If you hold down the Shift key on Windows or the Option key on Macintosh, there will be no warning. The record will be deleted instantly. It's a great timesaver but be very careful with it. Be sure you have a current back-up before you start deleting lots of records.

uLearnIT gains FileMaker Authorised Trainer status

Friday, April 4th, 2008

uLearnIT is proud to announce that David Head has been recognised as a FileMaker Authorised Trainer. As a FileMaker Authorised Trainer, David has undergone training directly from FileMaker, Inc. to deliver the FileMaker Training Series programs and has extensive knowledge of FileMaker best practices and solutions.

FileMaker Authorised Trainer

uLearnIT offers a three day course based on the official FileMaker Inc., training curriculum - the FileMaker Training Series. This course is scheduled for Sydney, Melbourne, Auckland and Christchurch. Check the course schedule for dates and costs. Book online early to avoid missing out on your place and to qualify for FREE FileMaker Training Series training materials valued at $129.