FileMaker Portal Row Click Handler

FileMaker Portal Row Click Handler

Keep up to date with CoreSolutions

FileMaker Portal Row Click Handler

FileMaker Portal Row Click Handler
Image of an old typewriter

Confessions of a FileMaker Developer

I have a confession to make.

I’ve been working with FileMaker software for about a decade now and sometimes I still do things the old fashioned way.

I caught myself doing this the other day when I discovered a new use for an old feature that I didn’t know could be used like this.

How I Used To Handle Row Click Events

Like most FileMaker developers I know, when I wanted to handle a row click event, I was creating a transparent button that hid in the background of the portal, taking up the entirety of the portal row. When a user clicked it, it performed its necessary button action/script and life was good.

The problem with this approach is that it’s somewhat clunky. You’ve got an extra layout object (the button) that exists solely to wait for a user to push it. Users don’t even see it, but know that something should happen if they click on a portal row – so that tells me that this kind of functionality should be inherent to portals, and that we shouldn’t have to create a workaround for this. This line of thinking is what caused me to do a bit of experimenting. It didn’t take me long to figure out a more elegant solution either, and as it turns out, my suspicions were correct.

How I Now Handle Row Click Events

Quite simple actually.

Add an OnObjectEnter script trigger to your entire portal. You can even pass the primary key of the related Table Occurrence (the one that the portal is based on) as a parameter.

That’s it!

Now, you don’t need to worry about that extra layout object getting in the way when you’re trying to multi-select objects within the portal.

I think the explanation that I provided here should probably suffice for most, but in case any of you want to see this in action (sometimes reverse engineering is more fun than reading about a technique), I’ve provided a demo… as usual.

Download the Portal Row Click Handler Solution

If you enjoy our FileMaker blogs, be sure to subscribe to our Core FileMaker Newsletter!

And as always, Thanks for Reading!

Matt Leering

Comments

Leave a Comment