Highlighting Rows in FileMaker lists or portals


Update: New Demo File is here. Added demo of Portal Row highlighting as well. This new demo employs a similar technique, except instead of using the Get(RecordID), instead, the script gets the actual ID from a field. It requires a few additional steps, but if you read through the stuff below, you should be able to discern what is going on.

Sometimes FileMaker’s built-in indicator for what row you are on in a list can be a little lacking. Fortunately, there is a solution to draw the users focus to the row they are one. Conditional formatting is a great feature of the new FileMaker. In combination with a calculation field, it can be used to highlight the row of a list.

FileMaker’s built-in row indicator

media_1278282000519.png

See that little black vertical line next to ‘Wendy’? That is all FileMaker has to indicate that you are on that record. Here is a better way.

Select the field to highlight

media_1269752902727.png

First we have to choose the field we are going to apply Conditional Formatting to.

In this case, I am selecting the field that holds the icon. I stretched the field to fill the area under the rest of the data fields in the row.

Orient field Left and Centre

media_1269753059896.png

I then set the icon to be left-aligned horizontally and centre-aligned on the vertical axis.

Conditionally Format the field

pastedgraphic-18.png

I use the icon field, expanded to fill the background behind the other data fields in a row. The formula is that the current Record ID is equal to a Globally declared Active Record ID. ($$ActiveRecordID).

Write this script

pastedgraphic-19.png

The script says, when you move to this field, set the Global to this record ID.

Call Script Trigger for Layout Setup

pastedgraphic-20.png

Call the script from the Layout as an OnRecordLoad calling the Highlight Row and using the let statement:

Let($$ActiveRecordID = Get(RecordID); “”)

So, we are setting it to the current record ID. If it is empty, then nothing.

Call ‘Highlight Row’ script

pastedgraphic-21.png

Make sure to add the script parameter to the Highlight Row script.

Let($$ActiveRecordID = Get(RecordID); “”)

List View with Row Selected

media_1269753344009.png

This is what the result looks like. Note that the selected row is highlighted. When combined with a Listener script for the Up/Down arrow keys and the Return key for selecting a record, it can speed up data entry significantly.

Related Articles:
How do I update information in a whole bunch of records at once in FileMaker?
Drag and Drop List or Portal Sorting
Listening for Keystrokes

11 Responses to “Highlighting Rows in FileMaker lists or portals”

  1. Write this script Can you explaine the script staps. TY

  2. homebasesoftware January 8, 2011 at 10:58 am

    The script step just refreshes the window. Refreshing the window causes the OnRecordLoad to trigger. That sets that causes the conditional formatting to happen. The result is that the highlighting row moves to the current record.

  3. This works just fine on list rows, tnx.

    I was looking for steps how to highlight active portal row and have found this explanation:

    Define a global field: gPortalRecID

    Write a script:

    #PortalRecID should be a serial number field that uniquely identifies one portal record

    Set Field [YourTable::gPortalRecID; PortalTable:: PortalRecID]

    Commit Record

    Select all the fields that make up your portal row and enter the following conditional format expression:

    YourTable::gPortalRecID = PortalTable:: PortalRecID

    Select the fill color you want to use to highlight the row.

    With these same fields selected, use button setup… to turn them into a button that performs the above script.

    …..works just fine.

    • homebasesoftware January 10, 2011 at 12:21 am

      This is the same basic technique. The advantage to the one I described above is you don’t need the global field. You are comparing the current record to a global variable instead of a global field. One less field keeps your data tables a little less cluttered. Both work well though.

  4. Matthew Bradley February 6, 2011 at 1:30 pm

    Just FYI, NickN’s example works for portals, where as your example is suited for list rows only and does NOT work for related portals. Your example didn’t explain this difference very well. Thanks, NickN. Thats exactly what I was looking for.

  5. HomeBase Software February 6, 2011 at 5:00 pm

    Hi Mathew and Nick,

    I added a demo file (see the top of this blog posting) which demonstrates how to use the same basic technique with portals as well as regular list views. Similar structure, except it uses the field ID to identify the current portal row. Using the same basic technique, we still don’t need to employ a global field. If you are using FileMaker 11, you will see the active record set to the $$Global on the layout as well.

  6. I avoid using Refresh unless absolutely necessary (particularly with the cache flushing option). Even on the straightforward layouts in your example the screen flickers as each row is clicked – on Windows (no problem on a Mac). If you navigate quickly with the arrow keys it’s almost impossible to read the text as it flickers and redraws.

    If you use Freeze Window instead of Refresh, there is no screen redraw and it’s as smooth on Windows as it is on a Mac. Sometimes you need a Commit after the Freeze step too.

  7. Thanks for this technique, HomeBaseSoftware! And great tip from Tom Dupre. I was trying to figure out why I couldn’t move up and down the rows in my solution as fast as I could in the example file. The Freeze Window step solved it.

  8. Hi!!! I have a sugerence!!!
    Put a STOP SCRIPT after goto next register. This will scroll the page ONLY when it gets to the end of the windows and not thill the begining. Greetings!!!

Trackbacks/Pingbacks

  1. How do I update information in a whole bunch of records at once in FileMaker? | HomeBase Software - July 13, 2012

    […] Articles: Highlighting Rows in FileMaker lists or portals ‘Type Ahead’ Style Searching through Portals in FileMaker Pro Shortening URLs […]

  2. Listening for Keystrokes | HomeBase Software - July 14, 2012

    […] Articles: Highlighting Rows in FileMaker lists or portals Paradise by the Dashboard Light – Bouncing around in FileMaker, building Charts […]