2 Replies Latest reply on Apr 26, 2013 12:00 AM by DobrilAtanasov

    lock/unlock a record with a single click?

    DonorTracker

      Title

      lock/unlock a record with a single click?

      Post

      Is there an easy, straight-forward way to lock individual records so that they can't be changed unless (for example) the user unchecks a checkbox?

       

      I'm not looking for high-security; I just want to avoid making unintended changes to a record once I have entered the data correctly. This is for a single-user environment.

       

      FM Pro 10 Adv, Macintosh.  Thanks!

        • 1. Re: lock/unlock a record with a single click?
          ErichWetzel
            

          You could do this with a field that is a checkbox, which when checked puts "locked" into the field.  Then adjust the settings in privilege sets which allows editing of the showing record only if the box is unchecked.

           

          We have separate groups for general users and users who have the ability to change any part of any record at any time.  Our privilege set for general users is the only one which I edited for this.

           

          File > Manage > Accounts & Privileges > Privilege Sets > YOUR PRIVILEGE SET > Edit > Records > Custom Privileges... > In the new window select the appropriate table > At the bottom of the window change the pop up under "Edit" from Yes to Limited... > You will be presented with a calculation setup.  Set it up to allow editing if the field is empty.  An example calculation:

           

          If (IsEmpty(Table::checkboxfield) ; 1 ; 0 )

           

          If the checkbox is empty the If returns 1, if not empty 0.  Non zero results allow for editing.  Zero result restricts editing including the ability to uncheck the check box, so be careful using this unless you have multiple privilege sets and "data admin" type users who will always be able to uncheck the box.

           

          If (IsEmpty(Table::checkboxfield) or Get(ActiveFieldName) = "checkboxfield" ; 1 ; 0 ) would allow for the users in the privilege set to check the box off again by always allowing for editing of checkboxfield.

           

          I imagine that there will be other methods also.

           

          Hope this helps.

           

          -Erich 

          • 2. Re: lock/unlock a record with a single click?
            DobrilAtanasov

                 Another solution that I find useful, since it is much more flexible is to create a field, add it to the layout as a checkbox with a boolean values (1 or 0), when it is checked it becomes 1, otherwise 0. Than add three rows to the scripts for the buttons / script triggers to revert the changes in the record and halt the script in case that the field is = 1.

                 In the case shown on the attachement I check for two different locking mechanism.