FileMaker Pro Advanced – AutoComplete Video Example – YouTube
Click here to download the sample file.
FileMaker Pro Advanced AutoComplete Video
Hi, this is Don Clark of FM Database Consulting and FileMakerProGurus.com
Today I’m going to show you a simple technique that uses an Account Name value list with Auto Complete to assign the proper ID to an invoice record’s foreign key.
A good use for this technique would be to link an invoice to an account.
There are other techniques out there to accomplish the same result, but I have a client that does not like to scroll through dropdown or popup value lists, and is not patient enough to pop a new window, type and filter, and then choose from a list.
He wanted the drop down list to show the Account Name, and have the Auto Complete feature turned on, as well. This would allow him to just start typing the name and when he had typed enough to filter out all but the correct name, just hit the enter, return or tab key to finish entering the name and linking the invoice to the Account.
Normally, I would hide the foreign key field behind the Account Name field on the Invoice layout and show just the Account name in the value list as the second field. You can start typing and get the list filtered, but you have to type quickly or you will lose your place. When you select the name, the value entered into the field is the foreign key, not the name. Setting up your value this way disables the Auto Complete button.
So here’s my work around:
Use an Auto Complete drop down list with the value list being derived from the Account Name Field in the Accounts table.
As the user types, the correct name will eventually be isolated. The user then pressed enter, tab, or return, and a script trigger is fired upon exiting the Account Name field.
The script copies the exact Account Name from the field above, navigates to a blank Account layout, enters find mode, finds the correct Account record, saves the ID to a variable, returns to this layout, and sets the foreign key, id_Account, to the value of the correct Account.
Lookup values are automatically entered once the foreign key has been entered.
There are a couple of caveats —
1. Once you process an invoice, you should use security settings to prevent changes to the invoice. That will keep users from inadvertently changing the Account Name
2. This won’t work well if you have duplicate account names, which is not a problem with my client.
Jonathan Fletcher
December 6, 2013 @ 6:38 pm
I’m going to use that. Very efficient. Thanks, Don!
Don Clark
December 18, 2013 @ 2:47 pm
Hi Jonathan-
Glad you like it, and thanks for the feedback!
Don
Ko ko
January 27, 2014 @ 3:28 am
Hey Don!
Nice work..! How is it possible to download the sample file ?
Thank you…
Don Clark
January 27, 2014 @ 5:37 am
Hi Ko ko-
Register here: https://filemakerlovers-org.fmlovers.org/wp-login.php?action=register
The file is listed at the top of a list of free stuff you’ll find useful.
Marty Boyd
February 15, 2014 @ 6:55 pm
When I change the Account address it doesn’t change the invoices with that account name.