2 Replies Latest reply on Jun 29, 2013 9:58 AM by philmodjunk

    Ways to detect a user modifying a record

    MarcusCutler

      Title

      Ways to detect a user modifying a record

      Post

           Is there a Get function or calculation one can use to determine whether or not someone else is already modifying a record thats being hosted via a server, without  having to go into a record and try to modify it and see whether or not you get an error pop up?

        • 1. Re: Ways to detect a user modifying a record
          ninja

               Error Code #301 from the Get(LastError) function is that the record is in use by another user.

               If you had a script that changed something inconsequential (like a field you put there to be inconsequential), had the script change it, then did a commit record...getting Error 301 would show this.

               If you did a triggered script on Record Load, you could trap the error, look for that error code, and set a flag field for "in use".

                

               Just thinking out loud...

          • 2. Re: Ways to detect a user modifying a record
            philmodjunk

                 You can use:

                 Set Error Capture [on]

                 Open Record / request

                 If [ Get ( LastError )

                 to detect whether another user already has the record open for editing. This will also "capture" the record so that others cannot edit it until you commit the record.