8 Replies Latest reply on Feb 1, 2012 4:33 PM by Malcolm

    lock record after committing

    vijaybhanabhai

      How can i make a record unmodifyable once it is committed. Then how can i allow only adminstrator to be able to modify the record thru security or other way.

        • 1. Re: lock record after committing
          RayCologon

          vijaybhanabhai wrote:

           

          How can i make a record unmodifyable once it is committed. Then how can i allow only adminstrator to be able to modify the record thru security or other way.

           

          Hi vijaybhanabhai,

           

          There are a number of ways to go about locking records, but one of the most robust is to use the Record Level Access (RLA) controls in FileMaker's built-in security.

           

          Assuming you're using FileMaker 10 or later, if you:

          1. Create a number field in each table called "Locked",
          2. Create a "Lock On Commit" script that uses the Set Field[ ] command to set the Locked field to 1,
          3. On each layout specify an OnRecordCommit trigger to call the Lock On Commit script
          4. Specify limited edit and delete record privileges (in each user privilege set) with the formula Locked ≠ 1

           

          Then once records are first committed they will be unavailable for editing except by a user who is logged in with a [Full Access] account.

           

          FWIW, I am attaching a simple one-table demo file that shows this in operation.

           

          Regards,

          Ray

          ------------------------------------------------

          R J Cologon, Ph.D.

          FileMaker Certified Developer

          Author, FileMaker Pro 10 Bible

          NightWing Enterprises, Melbourne, Australia

          http://www.nightwingenterprises.com

          ------------------------------------------------

          • 2. Re: lock record after committing
            Vaughan

            vijaybhanabhai, be careful what you ask for.

             

            Locking the record immediately after commit menas that the users cannot correct typos, and they cannot part-enter a record if some data is missing.

             

            I inherited a solution that implemented a similar record locking scheme, and spent several weeks progressively removing it because users found it impossible to work with.

             

            If your intention is to prevent accidental record modification, implement a scheme where the record needs to be unlocked by the user before changes can be made. The step of explicitly unlocking the record ensures that unintended changes are prevented, but users are still able to change the record when they need to themselves.

            • 3. Re: lock record after committing
              RayCologon

              Vaughan wrote:

              vijaybhanabhai, be careful what you ask for.

               

              Hi Vaughan,

               

              Agreed - though the same could be said of quite a few of the questions asked on forums such as this... ;)

               

              A lock override or a clear (and not to onerous) mechanism for dealing with exceptions is a good idea in most situations where a data lock is in place.

               

              Cheers,

              Ray

              ------------------------------------------------

              R J Cologon, Ph.D.

              FileMaker Certified Developer

              Author, FileMaker Pro 10 Bible

              NightWing Enterprises, Melbourne, Australia

              http://www.nightwingenterprises.com

              ------------------------------------------------

              • 4. Re: lock record after committing
                beverly

                And this method has to be "locked down", so that the "unlock" method is not able to be done without many keys to open the door!

                 

                 

                I also like to log the record before "unlock" and after changes, regardless of who has the keys.

                 

                Beverly

                • 5. Re: lock record after committing
                  LauraZ.

                  Yes, edits often do not occur to the user immediately, and it makes them feel helpless and maybe even hateful when they can't fix their submissions. I like to give the record 12 -24 hours to edit, if the business rules allow. If you choose to do this, you could have your lock field be a calculation based on creation date or a time calc. You can also limit access to only the creator of the record for a set amount of time, so only the creator can edit it in the window allowed. Just some ideas. If a day ends on a record, most of the little stuff tends to have been dealt with.

                  Enjoy,

                  LauraZ.

                  • 6. Re: lock record after committing
                    RayCologon

                    LauraZ. wrote:

                    ...if the business rules allow...

                     

                    Hi Laura,

                     

                    That, right there, is the key. The process must support - and should align with - business rules and (in some cases) legal requirements.

                     

                    I'd agree that creating a process that's more restrictive or onerous than the business or statutory requirements would be self-defeating. However, I don't believe we have any information to indicate whether or not that may apply in vijaybhanabhai's case.

                     

                    Regards,

                    Ray

                    ------------------------------------------------

                    R J Cologon, Ph.D.

                    FileMaker Certified Developer

                    Author, FileMaker Pro 10 Bible

                    NightWing Enterprises, Melbourne, Australia

                    http://www.nightwingenterprises.com

                    ------------------------------------------------

                    • 7. Re: lock record after committing
                      vijaybhanabhai

                      How can we lock all the fields in a record after commit but leave one field in the layout to be modifyable by all users via script only. ( not modifyable via layout entry)

                      • 8. Re: lock record after committing
                        Malcolm

                        Lock all the fields. Have the script run with full user access permissions by checking the box at the bottom of the script dialog box.

                         

                        Malcolm