kdefilip Posted September 28, 2015 Posted September 28, 2015 Hi all I have a web viewer in a FMP database layout. All is functioning fine in the web viewer. Inside the web viewer I have a variable which is just a string of text. I can get this variable to print on screen in the web viewer so I am sure it is performing properly. However, I would like to now take this variable and its value and pass it back to FMP for use in a search script. I have fiddled around with the FMP URL, but I can not make it work. Currently, the variable name is "msg" and the url I am attempting to use looks like this: <a href="FMP://$/MyFMPdatabase/script=isolatesearch¶m=msg&value=$msg"> The error it throws is this: "The file MYFMPdatabase/script=isolatesearch¶m=msg&value=$msg.fmp12 could not be opened. Either the host is not available, or the file is not available on that host." Not sure why it's appending .fmp12 to the value either. Any suggestions on how I might accomplish this would be greatly appreciated. Thanks.
bruceR Posted September 28, 2015 Posted September 28, 2015 Please post a link that points to a description of how to use the FMP URL. When posting the link, look it over carefully to see how it differs from what you have done.
Sky Willmott Posted September 28, 2015 Posted September 28, 2015 (edited) It looks like you are using '/' after your database name when it should be a '?' Also param should just =$msg So your URL would be: <a href="FMP://$/MyFMPdatabase?script=isolatesearch¶m=$msg"> https://www.filemaker.com/help/14/fmp/en/html/sharing_data.17.6.html Edited September 28, 2015 by Sky Willmott 1
kdefilip Posted September 28, 2015 Author Posted September 28, 2015 BRUCER, link: http://isolutions-inc.com/2014/04/05/fmp-url-scheme-and-the-13-0v2-improvement/ Look at the last two examples - I don't see how it differs from mine at all.
kdefilip Posted September 29, 2015 Author Posted September 29, 2015 It looks like you are using '/' after your database name when it should be a '?' Also param should just =$msg So your URL would be: <a href="FMP://$/MyFMPdatabase?script=isolatesearch¶m=$msg"> https://www.filemaker.com/help/14/fmp/en/html/sharing_data.17.6.html Hi Sky, Thanks for the helpful advice. Even with your syntax, I am still getting an error, albeit a bit different. The error now says simply: "The file MyFMPDB could not be opened. Either the host is not available, or the file is not available on that host." Also, this example from the link you sent should work, but it isn't. Run the script ListClients from an open file named Clients.fmp12: fmp://$/Clients.fmp12?script=ListClients
kdefilip Posted September 29, 2015 Author Posted September 29, 2015 It looks like you are using '/' after your database name when it should be a '?' Also param should just =$msg So your URL would be: <a href="FMP://$/MyFMPdatabase?script=isolatesearch¶m=$msg"> https://www.filemaker.com/help/14/fmp/en/html/sharing_data.17.6.html Thanks Sky. I've got it. Using your example I found that my DB name was the issue. My DB name was MyFMPdb-V3.4. It didn't like either the hyphen or the DOT. Once I renamed my DB, I can now get it to go to the DB and start the script. Thanks for all your help. My last step will now be figuring out how to get the variable (msg) on my web viewer to be picked up in the URL so I can set it to a field in the layout. Thanks again.
jbante Posted September 29, 2015 Posted September 29, 2015 Also param should just =$msg So your URL would be: <a href="FMP://$/MyFMPdatabase?script=isolatesearch¶m=$msg"> I'm not sure that's what kdefilip is going for. The goal, as I understand it, is not to pass the literal text "$msg" (tasty as that sounds!) to the script, but the value from a JavaScript variable in the Web Viewer. That could be done either as a parameter: fmp://$/databaseName?script=isolatesearch¶m=<contents of JavaScript variable> Or that could be done by launching the script with the $message variable already set with the desired value: fmp://$/databaseName?script=isolatesearch&$message=<contents of JavaScript variable>
kdefilip Posted September 29, 2015 Author Posted September 29, 2015 I'm getting to the point that kdefilip doesn't know what kdefilip wants any more. Basically this is my problem: <div><a href=FMP://$/MyFMPdb?script=isolatemarkers¶m=\"msg\">Isolate</a></div> <!--This returns "msg" literal txt to the script --><div id=\"msg\"></div> <!-- This prints the actual contents of the variable msg to the page, as it should -->> Basically, no variation of the above FMP URL returns anything but literal text OR nothing at all, and at this point I have tried hundreds of variations. At this point, it appears that what I am trying to do is just not possible. Examples: <div><a href=FMP://$/MyFMPdb?script=isolatemarkers¶m=msg>Isolate</a></div> <!--This returns msg literal txt to the script --> <div><a href=FMP://$/MyFMPdb?script=isolatemarkers¶m=param=\"+msg+\">Isolate</a></div><!--This returns +msg+ literal txt to the script ->
jbante Posted September 30, 2015 Posted September 30, 2015 It looks like you're not getting the contents of the JavaScript msg variable into the URL. This is the mess that is HTML+CSS+JavaScript. It might be easier to generate the whole URL and open it leaning more heavily on JavaScript than HTML. Look at the example for the third answer on this Stack Overflow question, and see if that helps.
Recommended Posts
This topic is 3689 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now