4 Replies Latest reply on Mar 5, 2009 12:23 PM by kennyferg

    Lock a record



      Lock a record


      Apologies if this has been asked before - I cannot find a solution to something I hope is relatively simple.


      I am creating a ToDo list using FM10 and when a User selects 'Complete' from a drop-down list, I want to lock the record so that it is no longer editable. I still want to be able to view the record.


      Thanks for your help in advance.




        • 1. Re: Lock a record

          Hi Mark,


          There is probably an easier way to do this with triggers in FMP 10; but until someone posts it here this may help.


          For each edited field on your layout, set the Validation option to Validate by calculation.  In the specify dialog check that the drop-down list is not equal to 'Complete'.  Also deselect the 'Allow User to override' checkbox.

          • 2. Re: Lock a record

            Thank you so much Jade - I cannot tell you how long I spent trying to work this out!!!!



            Many thanks, its done the job!



            • 3. Re: Lock a record

              You can also do this through the permissions set.  Goto the specific table in the "edit" portion of the permissions dialog and set it to limited.


              Once you do this you will automatically get a calculation screen.  You calculation should read...


              Case(your_table::status = "complete" ; 0 ; 1 )


              This will result in a generic fmp error message letting the end user know they can not edit this record.



              You can expand the functionality of this with a free plugin called eventscript (http://www.softs4humans.com/FMPro_Plugins.html)


              This plug in will allow you to trigger a script that informs the user why the can not edit the record.  


              Your calculation would then look like this


              Case (your_table::status = "complete" ; 0 & S4HU_EventScript( get (filename) ; "permissions error" ; "" ); 1)


              This would trigger a script titled "permissions error".  In that script you would have a custom dialog explaining to the user why the record could not be edited.   


              I've used this solution for a job tracking system that locks a record after delivery or invoicing from being edited by producers (but is still editable by other users that have a different permissions set)


              Hope this helps 

              • 4. Re: Lock a record

                This place is brilliant!!!!


                This is the first time I have used the forum and I would like to say how fantastic I think it is.


                I spent a huge amount of time trying to solve this problem, and had pretty much decided I was going to have to give up and accept defeat. The first response from Jade worked really well, but then Marcus came up with a solution that worked even better.


                Thanks so much to you both!!!!