5 Replies Latest reply on Apr 10, 2013 2:47 PM by philmodjunk

    Ambiguous error message

    StuartElliott

      Summary

      Ambiguous error message

      Product

      FileMaker Pro

      Version

      12

      Operating system version

      Windows 7

      Description of the issue

      Ambiguous error message when running a script that gives NO HELP in debugging the problem.  The error message NEEDS more specifics.
      "This operation cannot be performed because one or more required related records are not available and cannot be created."
      FileMaker needs to specify WHICH records are REFERENCED that are not available.  Now it's a guessing game on my part to try to figure out what is missing.

      Also, the error message window gives me NO option to abort the script; I have to use Task Manager to kill it.

      Exact text of any error message(s) that appear

      "This operation cannot be performed because one or more required related records are not available and cannot be created."

      FileMaker_Pro_ambiguous_error_message.png

        • 1. Re: Ambiguous error message
          Fred(CH)

               Hi Stuart,

               From my own experience, this message is meaning that you are managing data (for instance add a line on a portal) from a context that the related data is effectively related but too far away, for example at a second level only. Thus, you need to first add a related record within the first level related table.

               I know it is not so clear cheeky. So here is an example :

               Assuming you have three related tables from the first to the last level (mother to child) : Customer <- Invoice <- Invoice line.

               I think you can receive this message if your are trying to add a record on the Invoice line's portal directly from the Customer table instead doing that from the Invoice table. AND unfortunately, you didn't add any related record on Invoice table.

               I am not shure but it cans help...

               Bye, Fred

               PS : Excuse for my bad english.

          • 2. Re: Ambiguous error message
            Fred(CH)

                  

                 

            Also, the error message window gives me NO option to abort the script; I have to use Task Manager to kill it.

                 Excuse me, i forgot to answer the second part :

                 Did you inserted a Allow User Abort [OFF] step on your script ? Generally it is the reason why you cannot abort the script execution...

                 Fred

            • 3. Re: Ambiguous error message
              StuartElliott

                   Fred:

                   Thank you so much for your response.  Yes, I have "Allow User Abort [On]".  I did fix the script.  I inserted a bunch of temporary Custom Dialog windows for different steps so I could follow the logic.  The problem with the script is that I have two tables in the database both with relationships to the same external database table.  Because there can only be one relationship to a table, a second occurance to the external database table had to be created in the "Relationships" tab of the Manage Database dialog window.  I needed to change references in the script from the first occurance to the second.

                    

                   BUT, my point is that if the error message window hadn't been so generic, I wouldn't have had to waste so much time scratching my head trying to figure it out.  FileMaker could have at least shown which line in the script was causing the problem so that I could figure it out quicker.  I consider that lazy programming.  And I discovered that the "...related records are not available..." phrase doesn't seem to be accurate.  From what I can tell, It had to do with table/column names, not rows (records).

              • 4. Re: Ambiguous error message
                Fred(CH)

                     Dear Stuart,

                     First, trust me please, i can perfectly understand what you are feeling.

                     But if you allow me to send you a suggestion, keep cool : as some skill will come effortsless, other will take so much time. I don't know why but this is it. Working around until you found, hours and hours, months... i too much know that.

                     OK this was the philosophic part. Now :

                     If you are dealing with a lot of scripts OR if your scripts are a bit complicated, i strongly recommend you the Pro Advanced version. It provides more tools like, for instance, a pretty nice Script Debugger and powerful Data Visualiser. With these, you can for instance, tell FileMaker to auto-prompt you and stop the script right there the error occured and the "critical" step will be selected. Then, the debugger will display a link to the error. You can see below what it is look like. Please note that the Set Error Capture [ON] step is preventing end-user prompting.

                     Let me know if you need more help.

                     Bye, Fred

                PS: I develop with FMP since 5 years (and know some people using it since 20 years). But anyways, i can assure you that FMI doesn't practice lazy programming. Its particularity is pecisely that it can be really comfortable for both : beginners, intermediates an experienced programmmers, AND for the end-user too. I like to say it contain multiple "layers" on it.

                PPS : You will find more info here about an incredible product : http://www.filemaker.com/products/filemaker-pro-advanced/

                wink

                • 5. Re: Ambiguous error message
                  philmodjunk

                       Error handling is something that needs to be improved in Filemaker.

                       Some errors...

                       1) are not errors from a developer or user perspective but return error codes and are logged as such on the server

                       Finds that don't find records with set error capture on (I can live with this one)
                       Go to Record [next, exit after last] when the exit condition happens (Say what?)

                       2) are silent, unless you check for the error code

                       copy,paste, insert steps when field is not present and accessible on the current layout

                       3) can trigger errors like this one: "They tell you there's an error but don't provide an option to halt the script."

                       4) can display an error dialog that cannot be suppressed by Set Error Capture[on]. An example is when a script that attempts to create a new file such as Save As PDF is unable to do so due to an invalid path variable

                       And it would be a major improvement if we could add an Error Handler code such as is possible with visual basic where an error triggers the handler and then the code we put in the handler can process the error and either halt the script or return execution to the next step in the script or both.