8 Replies Latest reply on Apr 11, 2013 4:46 PM by gsokolsky

    running scripts from server

    ChrisPye

      I have just started scheduling a script from Filemaker server, and even though it runs fine it does come up with an error.

       

      Looking at the server logs, it seems that when a script is run from the server that it starts by running the "startup" script in my solution, and that is causing the error. Is this normal

      behaviour? If so, how do I stop it?

       

      I have looked for more info about this on the FM site and in help, but haven't found anything useful yet..

       

      Any pointers to good information would be appreciated.

       

       

      Cheers,

      Chris...

        • 1. Re: running scripts from server
          debi

          Chris,

           

          You might try adding a check for application version in your startup script, along the lines of:

           

          If [ PatternCount ( Get ( ApplicationVersion ) ; “server” ) > 0 ]

             Exit Script

          Endif

           

          Debi Rubel

          FullCity Consulting

          1 of 1 people found this helpful
          • 2. Re: running scripts from server
            ChrisPye

            Thanks Debi,

             

            That did stop the startup script running, but I would still like to know the logic behind this happening.

             

            Also I still have another error, Schedule "ProspectStatusUpdate" scripting error (101) at "GP_Database b2 : Auto prospect grading SERVER : Go to Record/Request/Page".

             

            The script is pretty simple, it just loops through the records and changes the status of one field.

             

            Prospects: Auto prospect grading SERVER

            Go to Layout [ “Prospect Status” (Prospect_Status) ]

            Show All Records

            Go to Record/Request/Page

            [ First ]

            Loop

            Perform Script [ “Prospect Grading New” ]

            Go to Record/Request/Page

            [ Next; Exit after last ]

            End Loop

             

            • 3. Re: running scripts from server
              Mike_Mitchell

              Chris -

               

              The 101 error is normal when you hit the last record in the Go to Record / Request / Page [ Next; Exit after last ] step. It's a documented behavior. It means FileMaker tried to go to a record that's not there.

               

              If you want it to go away, replace the "Exit after last" with an Exit Loop If [ Get ( RecordNumber ) = Get ( FoundCount ) ] script step instead.

               

              HTH

               

              Mike

              1 of 1 people found this helpful
              • 4. Re: running scripts from server
                debi

                Chris,

                 

                Error 101 is "Record is missing." It is pretty standard at the end of a loop using Go to next, even with "exit after last" checked. This (and a few others I can't think of off-hand) are what I consider "false errors" - nothing to do but learn when to ignore them (because sometimes they really do deserve your attention). Or - if it bugs you when they pop the debugger during testing (as it bugs me) - trap for another condition to exit before you get to 101.

                 

                Debi Rubel

                FullCity Consulting

                • 5. Re: running scripts from server
                  ChrisPye

                  Thanks Mike, that makes sense.

                   

                  Is there a resource out there that explains these server script errors?  I have looked but can't find anything.

                   

                   

                  Chris

                  • 6. Re: running scripts from server
                    Mike_Mitchell

                    Chris -

                     

                    Error codes when running from Server are really no different than what you get when you run from the client. You can find a list of error codes here:

                     

                         http://www.filemaker.com/12help/html/error_codes.html#1030072

                     

                    or in the FileMaker Help inside the product.

                     

                    The only difference is that you might see errors that result from unsupported script steps when running server-side. I suggest you check all your scripts to make sure you're not using any steps that aren't supported (you can check compatibility inside each script with the "Show Compatibility" pull-down in the lower left-hand corner). You can also check Module 10 of the FTS for specifics on script behavior when running server-side.

                     

                    HTH

                     

                    Mike

                    • 7. Re: running scripts from server
                      ChrisPye

                      Thank you to both Debi and Mike..  I've got it all working fine, and have a much better understanding of server side scripts.

                       

                      Cheers,

                      Chris

                      • 8. Re: running scripts from server
                        gsokolsky

                        For what it's worth, I've found that server side scripts can't handle the Adjust Window [resize to fit] script step...if you have that set as a script trigger on any layouts that your server scripts navigates to for any reason.

                         

                        You're probably much better than I and never rely on navigation to a layout in a server script!

                         

                        Cheers!