4 Replies Latest reply on Dec 9, 2014 12:38 PM by lijnbach

    Find source of 509 Error

    lijnbach

      Title

      Find source of 509 Error

      Post

      Hello everybody,

      I have a script using 509 Error. (Fields may not be empty).

      If Get [ Get (LastError) = 509 ]

      Works all fine. But now I have more fields that may not be empty. Even then the 509 error works fine. What I want, is to find out which field is the source of the error. (At this moment the focus goes to the first field of the table after the error, and not to the appropriate field). I can also use the standard FM dialog box (if ErrorCapture is off). This also works fine, but I have users who don't understand the standard dialog box. That is why I wrote my own script for these kind of messages.

      Is there a way to determine the source field of the error?

      Thanks in advance,

      Hans Lijnbach.

        • 1. Re: Find source of 509 Error
          philmodjunk

          Not without scripting. You can Use OnRecordCommit to perform a script and detect the error. Then check each field in turn and stop on the first one that's empty.

          • 2. Re: Find source of 509 Error
            lijnbach

            O.K. Phil,

            Thanks again for your help. At this moment I use a "general script" (OnRecordCommit) and check for 509 and 504 errors, and built in my own messages. Works fine. If I have to check the fields one by one, to find out which one is empty, I will have to make a script for each situation. That's no problem, just a little more work.

            I was hoping there was a way to find the source field, because the original FM message (with ErrorCapture off) returns the field that is the source of the problem. (But also returns to the first field of the table).

            Thanks Phil,

            Hans Lijnbach

            PS. I am still working on my crash problem. TSGal asked me to send the file to them. As soon as I find out (or FM finds it out) what the source of the crash is, I will let you know.

             

            • 3. Re: Find source of 509 Error
              philmodjunk

              One option is to set up the OnObjectValidate trigger on each field. This can be a general script using Get ( ActiveFieldContents ) to check the field's value.

              Another might be to give each field an object name that matches the field name, then pass the list of fields that can't be empty to the script as a script parameter and use go to object to go to each field and test its value in turn.

              • 4. Re: Find source of 509 Error
                lijnbach

                Thanks for the additional suggestions Phil,

                I tried them out, and the second suggestion works best. The first one works fine also, but a user can still "skip" a field (with the mouse). And if they skip a field, there is no "OnObjectValidate". So I will use the second suggestion.

                Thanks Phil,

                Hans Lijnbach