Window Management in FileMaker Pro – Preventing Extra Windows from Opening


I came across a situation recently where I had to build an interface to match Documents up with Contacts. The documents were coming in imported and needed to be reviewed and tagged to link them to contacts. My first version of the system was rejected by the customers because it kept opening extra windows, confusing the users. So I set about writing a fairly modular script that I could reuse to test if a window was already open and if so, simply select it, rather than opening another new window. This seemed to make the users much happier. I share it with you and my future self here.

What it Looks Like

 Records and List

Download Demo

Script: Window Management – Test Window is Open {Parameters: Name|Top|Left}

window-management-test-window-is-open-parameters-name-top-left-.png

Calling the Window Management Script

calling-the-window-management-script.png

Rather than using a Go to Related Record, I get the ID from the portal row, open or select the requested window and then perform a Find to get to the target record. If there is no ID, then don’t run the script.

One More Thing

one-more-thing.png

My approach to this presupposes that in Window Names are the same as Layout Names. In fact to get it to work in the Contact Management Starter Solution, I had to add a Rename Window step to the On Open script in the demo file.

Hope this is useful. I would be interested to hear how others handle this issue. It doesn’t come up all the time, but it is good to have a solution ready to go.

Update: Ethan Shosin on Twitter suggested: “Wouldn’t it be simpler to select window by name and if error (captured) open it? If no error then it exists open a Window.

Advertisements

Comments are closed.

%d bloggers like this: