4 Replies Latest reply on Jul 9, 2010 5:32 PM by Radcon

    Record Locking strategy ideas sought

    Radcon

      Title

      Record Locking strategy ideas sought

      Post

      I use the below script and appropriate privilege sets to lock the records of my database.


      Show All Records
      Go to Record/Request/Page[ First ]
      Loop
            Set Field [ Items::Lock; 0 ]
            Go to Record/Request/Page[ Next; Exit after last ]
      End Loop

      The script runs when the file is opened  (File Options, Open/Close,When  opening this file, perform script).  When a user opens the file via a  "opener file", I want all the records  to be locked so that data is not  casually changed.  Certain users can  unlock individual records as  needed for editing; I just don't want  editing to occur without the user  being reminded that they are about to  make changes to the data.  Is there a better way to ensure that all records are locked when a user logs on?

      I would like to get rid of the overhead of looping through  all the records on a frequent basis and could instead re-lock the record when the user is finished editing, but I am concerned that a user  might un-gracefully exit the program before the record lock field was  changed back to 0 and that somehow a 1 ends up where a 0 should  be.  Are my concerns groundless?

      Thanks for your ideas...