4 Replies Latest reply on Feb 11, 2014 12:09 AM by CarlSchwarz

    Perform Script on Server funny behaviour

    CarlSchwarz

      I call a script on the server, and then set a field using get(scriptresult).

      i.e.

      Perform script on server(set persistant ID)

      set field (table::Persistent ID) ; get(scriptresult)

       

       

      2 Very weird things are happening.

      1) If I take the setfield script step away filemaker hangs waiting for the server to respond.

      2) If I leave the setfield scriptstep in the file doesn't hang BUT here is the really weird bit, the contents of that field are cleared when calling this script on the server!! There are no relationships or auto lookups involved.

       

       

      The only script step in the server script is this:

      Exit Script [Result: Get(PersistentID)]

       

      I've tried recovering the file and deleting and recreating the field etc and putting the field in a different table and nothing fixes this! How can the "Exit Script" step above be changing any data in the database??? And why does the filemaker completely freeze up if I take the setfield script step away?

        • 1. Re: Perform Script on Server funny behaviour
          DavidJondreau

          I'm a little confused...

           

          It sounds like you are using a script to call itself using Perform Script On Server[]. Is that right?

           

          Do you have one script:

           

          Name

          Set Persistent ID

           

          Script Steps

          Perform Script on Server [ Set Persistent ID ]

          Set Field [ table::persistent ID ] ; get ( Script Result)

           

          or do you have two scripts:

          Name

          Set Persistent ID

          Script steps

          Exit Script [ get ( PersistentID ) ]

           

          Name

          Server Script

          Script Steps

          Perform Script on Server [ Set Persistent ID ]

          Set Field [ table::persistent ID ] ; get ( Script Result)

          • 2. Re: Perform Script on Server funny behaviour
            CarlSchwarz

            I have two scripts just as you explain it in the second part.  I recreated the same scripts/fields in another database and it works fine.

            I think I am working with a corrupt db but I don't know how to fix it as a recover has done nothing to help.  I've had other random problems with this file.  I'll keep working on it!  I'll have to work around it rather than recreate the DB as the file has had too much work done on it.

            • 3. Re: Perform Script on Server funny behaviour
              CarlSchwarz

              Here is a test Filemaker DB with 4 scripts.  When I load this database onto a server and call the 3rd and 4th script it works fine.

              When I copy and paste these scripts into the problem database and call it then it fails again!!

              • 4. Re: Perform Script on Server funny behaviour
                CarlSchwarz

                I found it!!!! Yay!

                I run a script "on first window open" and the server runs it whenever "perform script on server" is called.

                Funnily enough those set field steps I included in my original post were in the on first window open script and that is why they would get overwritten in the server.

                 

                Grrrr to me, wasting a day, and for blaming a "corrupt" db