9 Replies Latest reply on Sep 16, 2010 11:00 AM by philmodjunk

    Server Side FileMaker Scripts

    PaulJansen

      Title

      Server Side FileMaker Scripts

      Your post

      Hi,

      I am having trouble with a server side script giving the error 100 ( file is missing )  for a perform find script step and for a set field script step

      The script runs on a layout based on an external FileMaker file on the same server.  The script runs fine in the FMP client.

      Is there an issue with running server scripts on layouts based on external tables?

      Thanks

        • 1. Re: Server Side FileMaker Scripts
          philmodjunk

          Is the External Datasource reference that links this external file a relative path such as File: Filename?

          I believe that's necessary in order for your server side script to work correctly here.

          • 2. Re: Server Side FileMaker Scripts
            PaulJansen

            The file Reference on which the layout is based is of the form file:FileName.

            So I guess the problem must lie elsewhere.

            Thanks

            • 3. Re: Server Side FileMaker Scripts
              philmodjunk

              Or I may not be remembering things accurately. As a test, can you run this script from a client instance of FileMaker?

              • 4. Re: Server Side FileMaker Scripts
                PaulJansen

                Runs perfectly from a FileMaker Pro Client

                • 5. Re: Server Side FileMaker Scripts

                  Paul Jansen:

                  Does the script run any differently if you use the fmnet:/hostIPAddress/fileName format in the external file reference?

                  TSuki
                  FileMaker, Inc.

                  • 6. Re: Server Side FileMaker Scripts
                    PaulJansen

                    TSuki wrote:

                    Does the script run any differently if you use the fmnet:/hostIPAddress/fileName format in the external file reference?

                    The answer is no, I still get the same file is missing error in the server log.

                    • 7. Re: Server Side FileMaker Scripts
                      philmodjunk

                      I kept thinking there was an issue here that came up a few months ago, but I can't find anything to back that up. I just ran a simple test:

                      I created 2 files. A script in file2 simply creates a new record when called. An auto enter field logs the date and time each new record is created, so I can check the records to see if a new one was created and what date. A script in file1 calls the script in file2.

                      I uploaded the files into the same folder on the server. (The external file reference was File:FileName.) And created a schedule to run the script on the next half hour.

                      The script ran correctly on the half hour.

                      See anything different between what I did and what you are seeing?

                      • 8. Re: Server Side FileMaker Scripts
                        PaulJansen

                        I finally found the problem and the solution to this.

                        My file references to the external tables were of the form

                        file:data

                        I tried adding

                        fmnet:/serverip/data

                        but this made no difference.

                        After messing around for ages, I had an inspiration.  My files for this solution are divided between several folders for staggering the backups which as far as FMPro is concerned is irelevant when accessing the files hosted by FMS

                        However, it seems that when running server scripts the file references need to include the relative paths inorder to find the files. so adding

                        file:../folder/data

                        the the file reference solved the problem.  This does surprise me somewhat.

                        I will not forget this in a hurry and at least I now have a solution!  Just trying to decide if I can charge the client for the day wasted :)

                        Cheers

                        • 9. Re: Server Side FileMaker Scripts
                          philmodjunk

                          That was it. Should have thought to ask if they were all in the same folder or not. I can't find a Knowledge Base article that documents this and we need one, but server scripts require valid relative path references for any external files.