6 Replies Latest reply on Oct 21, 2012 2:37 AM by rudiwer

    get(lasterror) quetion



      get(lasterror) quetion




           I have a field in a file where the option     value in the database file is required in validation entry options, in file properties is set.

      I want to display a custom message if this is not true.

      I tought i can trap this error with get(lasterror)=505 but Filemaker shows always its own message before trapping my errorcode and as a result i get always the filemaker message 

      Any idea how i can resolve this ?

        • 1. Re: get(lasterror) quetion


               Before you'll have to suppress FM's message with the step:
               Set Error Capture [ On ]
               and only then trap for errors.
          • 2. Re: get(lasterror) quetion

                 In the script i SET ERROR CAPTURE (ON)

                 But filemaker still gives the message ???

                 I put my script on the trigger of the field 'on validation object

                 Any idea ???


            • 3. Re: get(lasterror) quetion

                   If the script is fired by that trigger, you do not need to trap for errors, neither to suppress FM's error message.

                   Try something like:

                   Show Custom Dialog [ "what you want" ]
                   Exit Script [ Result: 0 ]

              • 4. Re: get(lasterror) quetion


                     I am a newbie on filemaker so i will a bit better explain waht i do and want

                     I have a field (with a list on it to a related file)

                     I want that when i type a value thats not in the related file ther comes a dialog that asks to add a new record in the related file

                     I tought to do it with trapping error 505 but thats not the right choice ??

                     I do not understand well your previous command !

                     and.... thanks for the response !


                • 5. Re: get(lasterror) quetion


                       Then try this script:
                       If [ IsEmpty ( FilterValues ( Get ( ActiveFieldContents ) ; ValueListItems ( Get ( FileName ) ; "TheNameOfYourValueListInQuotes" ) ) ) ]
                       Show Custom Dialog [ "add a new record in the related file" ]
                       Exit Script [ Result: 0 ]
                       End If
                  • 6. Re: get(lasterror) quetion

                         heyee guys,


                         Thanks you are great one of the biggest advantages of filemaker - a hell of a forum !!! for newbies like me !