3

I would like to use the Filemaker web viewer to build and style a database navigation menu. I have found a handful of samples and I have played with the code but the problem that I am having is that it launches in another window (Note that I also have several versions of Filemaker on my desktop and it also tries to launch the pop up in Filemaker 13 when I am building in Filemaker 12).

The goal is to call the script inside of the current database and current application so that it functions as a system navigation menu. In straight HTML in a site environment I would add target="_blank" or target="_parent" to the href but I can't seem to get the syntax right to try it in the web viewer and I'm not sure if this would be the solution. Can any angel from tech heaven assist or offer any advice? Here is the sample code that I currently have that calls a Filemaker script in a local system for a google map interface. I'll be using the script differently but the structure will be the same.

    "data:text/html," &"
    <html>
    <body>
    <a href='"&"FMP://" & 

    Case(
    IsEmpty(Get(HostIPAddress));  Get(SystemIPAddress); 
    not IsEmpty(Get(HostIPAddress)); Get(HostIPAddress);
    )

    &"/"& Get ( FileName )& "?script=Open-Detail-Map&param=" & Data::ID_Data&"'>View Map 
    Detail</a>
    </body>
    </html>"
Thesis
  • 296
  • 1
  • 2
  • 22

4 Answers4

1

This works for me, and it opens it in the same window. I'd recommend using FileMaker 13 for development, or uninstalling it. It launches in 13 because the URL protocol handler (FMP) is the same for both versions, so your OS uses the newest version of FileMaker to handle the URL call.

Note that triggering scripts using a URL will not work in standalone files in FileMaker Pro, only hosted files or FileMaker Go.

Sam Barnum
  • 10,559
  • 3
  • 54
  • 60
0

It is possible to call the script from another file directly in FileMaker, rather than trying to do it from a webviewer. Can you clarify why you're trying to create your navigation menu in a webviewer?

If a webviewer is not compulsory, I would recommend:

  1. creating an External Data Source that points at the other file
  2. Adding FileMaker buttons for your navigation
  3. Right-click on the button you want to trigger the script, and choose "Button Setup", then choose "Perform a Script" and specify the script you want to run from the other file.
CristosLC
  • 412
  • 4
  • 16
0

Honestly, this makes no real sense to do. I get what you are trying and it seems interesting, but build your navigation in FileMaker and display your banner ads in a web viewer. The other option, which is always available, is to just build out the solution as a PHP site using the FMP PHP API.

VikingBlooded
  • 884
  • 1
  • 6
  • 17
0

I realize that this is an answer for a rather old question, but I think it warrants pointing out what the solution here is...at least in modern versions of FileMaker. I don't recall exactly when this was fixed...13.05 or .06? It was present in earlier versions but wouldn't work for locally opened files, only hosted files; now it works in both.

You need to use the 'currently open file' reference in the FMP URL: "$". So your URL string should look like this:

"fmp://$/fileName?script=AScriptName&param=..."

In your code:

<a href='"&"FMP://" & 
    If ( IsEmpty(Get(HostIPAddress)); "$"; Get(HostIPAddress) )
    &"/"& Get ( FileName )& "?script=Open-Detail-Map&param=" & Data::ID_Data&"'>View Map Detail</a>
Cronk
  • 453
  • 1
  • 6
  • 16