1 Reply Latest reply on Jul 31, 2014 1:53 PM by philmodjunk

    Error catching

    RichNasser

      Title

      Error catching

      Post

           I am getting the following error : XXXX is modifying this record.  You cannot use this record until XXXX is finished.

           I've been trying to determine what Error code that is to write some exception handling in my script.  When I set error capture to on and try to Dialog Box the error code it shows "0"

            

           so it doesn't seem that this is an error, rather it won't allow the user access a record in use - so is there any helpful scripting  out there to help with this situation or is the standard dialog box that pops up my only option?


           Thanks

        • 1. Re: Error catching
          philmodjunk

               First an explanation of how/why this error appears:

               On a hosted database, only one user is allowed to open a given record at a time for editing. If user 1 puts the cursor into a field of Record A, no other user may enter a field of this record in order to edit it until user 1 commits the changes--closing the record and releasing it for access by other users. This is a very necessary requirement for properly managing edits to data in a multi-user environment.

               Then for the error code.

               301, Record is in use by another user

               Should be the error code returned when an "edit lock" error occurs. How did you set up a method for capturing this error?

               If you used get ( LastErrorCapture), be advised that this must be used immediately after the script that might generate the error that you are testing for such as:

               Open Record/Request
               Set Variable [$Err ; Value: Get ( LastError ) ]

               If you put anyhing between the Get ( lastError ) and the script step that may generate an error, it doesn't work.

               In this example:

               Open Record/Request
               Set Variable [$K ; value: $K + 1 ]
               Set Variable [$Err ; Value: Get ( LastError ) ]

               $Err will always get the value 0.