1 Reply Latest reply on Aug 26, 2013 11:36 AM by philmodjunk

    get (lasterror) condition

    emmawatson

      Title

      get (lasterror) condition

      Post

           I use this function "If Get (LastError) > 0" several times in my script while performing several searches on different layouts.

           Is there any way to clear it? E.g. if I get the error at 1st time, go further, and when the script uses it second time it does not make sense, because it will be > 0. So I want to clear its condition to perform next LastError check.

           As I have found here: https://www.filemaker.com/12help/html/func_ref2.32.42.html

           it says:

           

                When you perform a script that uses this function with control script steps, the control script steps do not clear the last error condition

            

        • 1. Re: get (lasterror) condition
          philmodjunk

               For scripted finds, I rarely bother with get ( LastError ). I just use: Not Get ( FoundCount ) to identify a 0 found records result for my find..

               The error code will not persist. Each performed find will generate a new error code or clear it if records are indeed found. Error codes are, in fact, so ephemeral that you often need to assign them to variables immediately after the action that may have generated the error code unless you use an if step to test for that code immediately after the step that may have produced the error.