2 Replies Latest reply on Apr 9, 2014 5:10 PM by firebase

    Server Side Scripts



      Server Side Scripts


           it just took me 2 hours to find out that global fields are not working on server side script.

           i also cant find a manual that describes these problems.

           is there really no usefull text about this?

        • 1. Re: Server Side Scripts

               There's an entry in FileMaker Help on this new script step, though it leaves out any reference to global fields. For those of us that have used server scheduled scripts, this is a well known limitation. But the documentation should mention this detail for the new script step.

               Server Side Scripts are, by definition, performed on the Server, not the client. So the current record, current layout, values in global fields or variables are all not accessible to a script performed on the server.

               The key to getting such a script to work, is to pass all of this data to the server side script in a script parameter. You can use a calculation to combine multiple values into a single string to pass to the server side script and it can then parse the individual values back out of the string.

               I often pass multiple values to a script like this: List ( value1 ; Value2 ; Value3 ) // place this in the optional script parameter box.

               Then the script uses a calculation such as GetValue ( Get (ScriptParameter ) ; 1 ) to parse Value1 back out of the parameter string.

               Other methods are also possible.

          • 2. Re: Server Side Scripts

                 ok, thanx. i simply used a new db to fill up "a kind of" global fild which i used to parse json.