4 Replies Latest reply on Jul 14, 2014 10:09 AM by TSGal

    Perform Script on Server: Scripting Error 3 and 101

    scottworld

      Summary

      Perform Script on Server: Scripting Error 3 and 101

      Product

      FileMaker Server

      Version

      13.0v2

      Operating system version

      OS X 10.9.2

      Description of the issue

      Hi there,

      We have started using the new "Perform Script on Server" functionality in FileMaker Pro 13 in conjunction with FileMaker Server 13. It works just fine.

      However, we were glancing through the FileMaker Server logs yesterday, and EVERY SINGLE TIME a user runs a script using "Perform Script on Server", it is logged in the FileMaker Server logs with either a "scripting error (3)" or a "scripting error (101)". This makes no sense at all because everything is operating 100% correctly! It makes even less sense after you look up what error #3 and error #101 is:

      Error #3 is "Command is unavailable (for example, wrong operating system, wrong mode, etc.)". This is NOT a valid error message for us, because our server scripts are ONLY USING script steps that are compatible with FileMaker Server. There isn't a single script step we're using in our server scripts that ISN'T compatible with FileMaker Server. Furthermore, our "OnFirstWindowOpen" script trigger immediately evaluates whether the user is the Server machine by evaluating the results of this calculation:
      PatternCount ( Get (ApplicationVersion); "Server"))
      So, if the Server is opening the database, FileMaker doesn't do any pre-processing of the database in any way. It simply goes to a blank layout with no script triggers on that layout and doesn't take any further actions -- it simply runs the server script that it was called upon to do, and the server script is using 100% server-compatible script steps.

      Error #101 is "Record is missing". Again, this makes no sense, because all of the server scripts always successfully execute just fine, and no records are ever missing. Each server script starts by going to the appropriate layout, entering find mode, then performing a find for the primary key of the record that needs to be processed. The record always exists in the database, because the users have no ability to delete any records from the database.

      So I'm very confused as to why FileMaker Server 13 keeps yielding these same 2 invalid error messages over & over again to us… is this a bug in FileMaker Server 13?

      Thanks,
      Scott

        • 1. Re: Perform Script on Server: Scripting Error 3 and 101
          Fred(CH)

               Hi Scotty,

               

          Error #101 is "Record is missing". Again, this makes no sense, because all of the server scripts always successfully execute just fine, and no records are ever missing. Each server script starts by going to the appropriate layout, entering find mode, then performing a find for the primary key of the record that needs to be processed. The record always exists in the database, because the users have no ability to delete any records from the database.

               Error 101 is also systematically generated, before exiting a loop, where the action Go to Record/Request/Page [Next; Exit after last ] is performed the last time, since the current record is the last record and you cannot browse farther.

               The same can occurs with Go to Portal Row.

               Did you have such loops in your server scripts ?

               Bye, Fred

          • 2. Re: Perform Script on Server: Scripting Error 3 and 101
            scottworld

                 Thanks so much, Fred, for the insight into error 101! Yes, i do have loops in my server scripts, so that explains that particular error message!! Thank you for your explanation! It would be AMAZING if FileMaker Inc. updated their documentation with the information you just shared with me, so developers aren't left guessing about these sorts of things.

                 Now all I need to figure out is why FileMaker Server keeps listing that error #3….

                 Many thanks,

                 Scott

            • 3. Re: Perform Script on Server: Scripting Error 3 and 101
              philmodjunk

                   Can you identify what part of the script is generating that error code? Just a wild guess here, but if there may be a script step--which might be compatible but unavailable that is tripping this error and not executing without having a noticeable affect on the desired results.

                   You might test portions of your script in isolation to see which portion logs that error as a way to narrow it down.

                   (I recently was ready to write up a long bug report on FM GO because I kept getting Error 3 even though my script was totally GO compatible, but then I realized that I was trying to do a "save a copy as.." step from a client session of FM GO hosted from my laptop--my standard test bed for FM GO development. Once I copied the file over to the iPhone I was using, the script worked exactly as I intended it to...)

                   You might be interested in my recent posted feedback on FileMaker Error Handling in Scripts: http://forums.filemaker.com/posts/56b3613440

              • 4. Re: Perform Script on Server: Scripting Error 3 and 101
                TSGal

                     scotty321:

                     Thank you for your post.

                     For testing purposes, temporarily turn off the opening script.  Then, create a script with the script step "Perform Script on Server", and reference the startup script.  This will let you know if the error #3 is being triggered from the startup script.

                     If feasible, post the script that is generating the error 3.

                     TSGal
                     FileMaker, Inc.