I’m a big advocate of simplicity whenever possible, and FileMaker’s native drop-downs are usually the best choice. There are times, however, when I’d like a little more. Luckily, FileMaker gives us the tools to hunt for ourselves. So, today, I’d like to explain an experimentation with the concept of custom drop-down menus.
What are we doing?
The idea behind this example is to use a hidden popover button that, when activated, will effectively replace a regular field with a global field and a portal. The global field will be used as an autocomplete/search field, and the portal will show results driven by the value of the global field. A script trigger attached to our regular field, On Object Enter, will:
- Activate the hidden popover
- Set the global field with the current contents of our regular field
- Set our cursor in the same position that it had been in
- Show the appropriate results in our portal
From there, we have some additional machinery behind the scenes to handle the searching of those records in an efficient way that doesn’t break our user’s context.
Outcome
The result is a searchable, drop-down style-picker that shows as much information as you need. The most obvious use is to link records together, but I’ve found some other pretty neat use cases for this kind of thing, including a universal spotlight style search that we recently whipped up for one of our clients.
The file
Now that you’re familiar with the thought process behind this demo, download our FileMaker demonstration with custom drop-down menus.
Also, shout outs to Soliant Consulting for the test data generator and Seedcode for the control file/virtual list setups! We used the test data generator to populate the 8,000 sample contacts, and the control file and virtual list methods were used for the purposes of finding and displaying the records in our custom drop-down menu.
About the Author
Mike Beargie has been with MainSpring since 2013 and has over 10 years of application development experience. As a developer, he creates solutions for clients in a wide variety of sectors across the U.S. and abroad. Prior to working at MainSpring, Mike worked as the lead developer for a consulting company, serving high profile political, special interest and nonprofit clients in the Washington, D.C., and Columbus, Ohio, markets. Mike regularly presents solutions and best practices to the FileMaker development community around the country, and is well known as an answer man online as well. In 2014 and 2016, Mike was recognized with the FileMaker Excellence Award for community contributions. Mike is a man of many hobbies, including woodworking, home brewing, art and music.