2 Replies Latest reply on Feb 9, 2016 5:08 PM by macwombat

    Lock down field edits script


      I have a situation where a user clicks a submit button and the data is created in a new record in another table (for other users to view/act on). My issue is that once submitted (button is clicked), I want certain fields to not be able to be modified through a script. The submit button means I checked my data and I am comfortable with locking it down and sending it out.


      I do provide the user to inactivate the record and start over, but I don't want them modifying their past records they created.

        • 1. Re: Lock down field edits script
          Stephen Huston

          I would handle this by limiting editing access to specific fields for users via the Manage > Security  privilege set(s) so that users in a privilege set can only edit specific fields if certain conditions are met, such as IsEmpty(submitField). This takes some planning of the security system.

          You can also limit access by removing certain fields from the Tab Order in Layout Mode, and then set the fields as buttons which run a script to determine if they may enter the field(s) with a similar test.

          • 2. Re: Lock down field edits script

            Like many things in FileMaker there are probably lots of ways to deal with this.  A couple I can think of.  Both require a Submitted field to be created that indicates if the record has been submitted.  A number field will be fine.  When the record is submitted the script sets that field to 1.

            1.  Have 2 layouts that look the same.  One layout has fields which allow field entry in browse mode and one does not.  A script trigger OnRecordLoad checks the record to see if the Submit field is set to 1.  If it is set to 1, then the user is taken into the layout which does not allow field entry in browse mode.  If the Submit field is not set to 1 then the user is taken to the layout that allows field entry in browse mode.




            2.  All the fields that are on the layout have a validation by calculation: IsEmpty ( Submitted ).  Also, in validation uncheck the box to allow user override during data entry.


            HTH.  Chris