Many FileMaker developers use FMP URL links in order to get FileMaker scripts to run from actions taken in a web viewer. For example, this is how DayBack calendar runs your FileMaker scripts when you edit an event in the calendar.

When FMP URL links are functioning properly, these scripts can update records flawlessly. When they don’t work correctly, they may try to open another copy of FileMaker, or just fail silently. And things that fail silently can be really hard to hunt down.

Here’s a great introduction to these URLs if you’re new to them: the FMP URL protocol in FileMaker. But don’t worry, you don’t need to know how these work to use DayBack, ProMaps, or any of the other apps based on web viewers. In fact, when you’re using DayBack and have your script debugger on, DayBack’s FileMaker scripts fire when you’re editing events just as if they were called without a URL.

When we were trying to come up with a way to verify that a client’s FMP URL links were working properly, we first came up with the idea to run a script upon opening the file that uses the “Open URL” function. This URL sets a global variable in the file to “true”, which is then checked further in the script to verify that FMP URL links are functioning. If the variable is not set, then the script throws an error.

Here’s our first attempt at seeing if the URL was firing:

Unfortunately, we found that the “Open URL” script step sometimes resulted in the test passing, even when FMP URLs were not functioning properly.

It turns out the “Open URL” script step works just a bit differently than FMP URLs started in the web viewer: the script step almost always targeted the correct version of FileMaker, while the same URL called from the web viewer would not.

It seems the only way to definitively test the functionality of FMP URL links is to start the test from a web viewer or a browser: we opted make a web page available that the user can browse to and click a link to run a script in the file.

You can see our test in DayBack’s documentation here: FMP URLs

One caveat to this method is that the user’s file name must match the filename in the link. This is why we’ve included instructions on copying and pasting the link into their browser’s address bar, customizing the link to their own file name.

FMP URL link issues can be tricky to diagnose. Hopefully, this can be helpful for those of you running into the same issues in your environment.

4 Responses to The FMP URL protocol in FileMaker – Making sure it’s working

  1. Laura Betz says:

    The calling of a FMP-url in a webviewer opening the wrong version happens to me, which then requires me to work in only one version of FileMaker at a time. Not usually a problem, but it did get in the way at times.

    I don’t know of a good way around that, but would be interested to know.

    • seedcode says:

      Having it work in whatever (one) version you have open is currently the best experience available. I believe we’d need FMI to make the url version specific to let multiple copies run at the same time.

      • steve ssh says:

        Hi John,

        Specific to OS X:

        I wonder if you might be able to share any insight on how to fix the situation where invoking the FMP URL results in the OS attempting to launch an *older* version of FMP which is not presently running. I some research into the lsregister CLI tool to attempt to unregister older versions of FMP, and also ensure that the desired version was registered. This helped, but does not seem to be a true long term solution, since, if a user ever launches the older version of FMP, it will re-register itself, and result in the same behavior mentioned above, i.e. the OS will attempt to use the older version even if it is not currently running. Specifically I am dealing with a situation where using FMP URLs in v.15 results in the OS launching v.14.. This only happens on some users’ systems. I am stumped. Any thoughts? Thank you very much & kindest regards, -steve

  2. MrWatson says:

    Just never use any technology which works only “almost always” ! Databases need to be based on technologies which work “always always”!

Leave a Reply

Your email address will not be published. Required fields are marked *

Share →
DayBack Calendar
DayBack's 30-day trial is unlocked so you can customize it and integrate it with your files.
Download DayBack and we'll send you a couple short emails with tips on how to modify it and use some of the coolest features.
Thank you! Please download: DayBack Calendar
Need More?
SeedCode tips & example files in your inbox
Need More?
SeedCode tips & example files in your inbox
Want More?
Be the first to see articles and tips like these
Download TimeZync and we'll send you a couple short emails with tips syncing your FileMaker Go files.
Thank you! Please download: TimeZync
Want More?
Be the first to see articles and tips like these