Jump to content

Saving javascript in global field


Rasse
 Share

This topic is 2810 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hey and good morning from Europe!

 

I have a problem saving javascript in global field. When I quit Filemaker, changes goes away and reverts back to old one. Is there a workaround for this?

 

 

This raises question for other people who needs to run the javascript? 

 

We are using Filemaker 13.0v3 & Filemaker Server 2013

 

 

Would one solution be to save it as normal field and make a script to update the global field which triggers when user need's the script?

 

Or is there a better solution for this?

 

Thank you for all the help I can get!

Link to comment
Share on other sites

In a hosted solution, a client can modify global fields only for the duration of the session. After that, they revert to the values entered the last time the file was opened in single-user mode.

 

 

Is there a workaround for this?

 

I am sure there is - but it would be useful to know how this javascript is being generated/modified and what is it used for. If, for example, it is used by a web viewer, why don't you keep it in inside the web viewer's setup?

Link to comment
Share on other sites

It sounds like you are sharing your database.  According to the FM Pro help manual, changes made to a global field are only saved if changes are made on the host computer.  

Link to comment
Share on other sites

Thank you for your reply. 

 

For now, I don't want to put it in web viewer because I'm developing the JavaScript code. I think it removes the formatting of the code, when I copy the source code from the web viewer. (Hmm, tested to add line break ¶, and it worked).  But still it's lot easier and cleaner when having the code in a field. 

 

I'm using d3js library and making custom JavaScript file for week overview of workers workload. It's pivot table(cross table) which I figured is easier and more cleaner to make with JavaScript than create with Filemaker.

 

Matthew:

Oh, I see, so it would work if I copy the database as local and deleted it from server. And when I'm finish editing a just upload back to the server.

Link to comment
Share on other sites

 I don't want to put it in web viewer because I'm developing the JavaScript code.
 
My own preference would be to put the Javascript in an external text file while still working on it (and use a text editor for this work), and point the web viewer to this file. When you are done, you can store the finished script in the web viewer (and keep the text file in case further modifications are needed).
 
 
 
In this context it might be useful to know:
Quote ( Textfield )
will escape your code, making it ready to include in a calculated HTML.
 
Evaluate ( Textfield )
will reverse the process.
  • Like 1
Link to comment
Share on other sites

This topic is 2810 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.