Jump to content
Sign in to follow this  

How to prevent "scripting error (401)" in server log?

Recommended Posts

I doubt many people care about this, but I'm annoyed that my Server Script is throwing errors in the server Log Viewer (under the Server Events module).  Specifically, error 401 (No records match the request) and 101 (Record is missing).  Even if I have Set Error Capture [On] in there and capture the error code using Get(LastError), FileMaker Server still throws an accusing finger at me and says "scripting error"!


It'd be nice to eliminate error warnings like this so I can focus on real errors that I care about.


I'm running FileMaker Server 12 Advanced (



Share this post

Link to post
Share on other sites

Do an ExecuteSQL to do a quick select, if that comes up empty you can skip the real FM find.

It's important to understand though that "Set Error Capture On" does not prevent the error from *happening*.  The only thing it does is hide the error from the user so that you can handle it silently.

If you run the same script in your debugger you will see that FM also reports the error.

  • Like 4

Share this post

Link to post
Share on other sites

Ahh, but that would require me to learn the Execute SQL script step!  ;)  Interesting tip; I may try that out.


As for capturing errors, I knew that errors were still reported, but I wasn't sure if it was germane to the issue at hand.

Share this post

Link to post
Share on other sites

Or use a relation to check if the found set exists.


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Content

    • By hutchlad
      Hi Guys, Just a quick question for a beginner, I have created multiple export scripts, and notice that when I create a master script with the numerous subscripts being called, sometimes the output isnt correct, whereas when I run each script one by one (rather than lots of subscripts within a master script) the final result is fine. Could there be anything wrong with using subscripts for this?
      Should I always have an Exit Script step at the end of each subscript? I hope that makes sense
    • By Agnes Riley
      I have a script that sends notification emails. It stopped sending emails after the server HD was cloned by their IT department.

      The script works as intended from FM, I receive the emails, client receives the emails.

      When sending from server, the scrip completes with errors:

      I really don't think the second error is relevant.

      I checked and the file permissions are correct for FM server, the login account clearly works.
      The system clock is fine on the server, getting time from Apple.

      Any ideas anyone?
    • By arbelbedak
      I've scheduled a server side script for the first time. The script is in our CRM database, and it essentially just "shows all" and then performs an export to a specific file path. I have set this to run every night at 8pm. 
      So far, I have not been able to get it to run successfully on schedule. When I run the script in the database itself, it exports the data successfully, but when the server runs the scheduled script, it gives scripting error (800), which is that it can't save the file in that location. 
      Am I doing something wrong? I even changed it so that the file exports to a location on the server itself, thinking maybe that was the problem. Still no luck. 
      I am running FMS 11 and FMP 11 on OSX 10.7.5
      Thank you for your help!
    • By Opotoc
      Hi guys,
      I have noticed that Server Adv.12.03 not longer clears the temp cache once a server script is finished. Usually the cache should be deleted once the server script is done, shouldn't it.
      It's happening on two Mac Servers 10.7.5 / 10.6.8
      Has anyone else this problem? Is is a bug?
      I love the temp cache. I use it a lot to get data from the internet into the database (Load, write to file in temp , import into database) using server scripts..
      So if there a bug, I will run into trouble.. only a question of time and disc space..
    • By jkluchnik
      I have been having a problem today trying to set up a script that runs on the server overnight which will gather currencies and security prices that need to be updated with the market closing values of the previous day. This script involved setting a filter field with the value Get ( currentdate ) - 1. The script runs with no errors but the filter field is not being set. It remains empty. When running this in a client, it works flawlessly.

      I found an article today which discusses differences in scripts being run on the client vs. the host. The article was not very clear but it seemed to imply that many of the Get ( ) functions return an empty value when running on the server.

      Can anybody verify if this is the case, and which functions will not work? The error logging for server side scripts is abysmal, and in this case, non-existent.

      If in fact this is true, would anybody know a workaround for the Get ( currentdate) function that would work on a scheduled script? I was quite dismayed to read this about Get ( ) functions as this makes server scheduled scripts practically useless for my purposes. And I had such big plans!
  • Who Viewed the Topic

    10 members have viewed this topic:
    Joe Luis  Blaze  jkluchnik  vinnygi  24u_testers  woz  soundsessential  ddinisco  dkey  Jennifer Bland 
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.