AnsweredAssumed Answered

Web Viewer Widget in JavaScript - Script call

Question asked by symont on Jan 4, 2019
Latest reply on Jan 4, 2019 by symont

I have been fiddling here and there with JavaScript for a few years on side projects (websites and a Node.js project). And I sometime incorporate some in Web Viewers for chart plotting or the like. But these were all passive outputs.


I never felt the need to bring this JavaScript world in second gear in my FileMaker practice and, to be honest, never really took the time explored the possibilities... until now.


This thread was an eye opener.

Navigation slider


I don't want to high jack it so here I go. I took the time to study Jeremy Brown's proposed solution. Very enlightening. First, I find the "Web Address" builder very inspiring. A clean way to build and troubleshoot an advanced Web Viewer URL/widget. Not sure if this is common practice or Jeremy's own way to do it but kudos for the inspiration.


And second, this simple three lines script first completely eluded me:

Close popover
Go to Record/Request/Page [With dialog:Off; $rec]
Exit Script [Text Result:""]


But... but... the local $rec variable was never defined???


The answer was in the JSFunction:

     var theURL = "fmp://$/**FileName**?script=Nav_GoToRecord&$rec="+value;
     window.location = theURL;


Wow, we can launch a script from the Web Viewer, and define a variable outside of this script?!?!?! This is so powerful, I want to learn more!


Therefore my question: where can I learn more about this? Any reading suggestion? I don't need a Web Viewer walkthrough. I don't need a JavaScript walkthrough. I want something specifically targeted to this marvelous link between the JavaScript world and FileMaker script.


Thank you for your time, and especially you Jeremy this time.