3 Replies Latest reply on Jan 16, 2009 7:26 AM by Jens Teich

    Make fields in a layout un-editable when two fields are not identical

    TomM

      Title

      Make fields in a layout un-editable when two fields are not identical

      Post

      Hi,

       

      Basically I have a database which keeps entries version controlled based upon two fields 'Version' and 'VersionOf' (e.g. Version 4 of 5). I wish to make all previous versions, i.e. any records where Version != VersionOf, un-editable such that users can't go back and change things that they previously entered. They can only edit the latest version, or add a new version.

       

      How would I do this?

       

      Thanks

      Tom. 

        • 1. Re: Make fields in a layout un-editable when two fields are not identical
          Jens Teich
             Your calculation can be entered in accounts and privileges per privilege set.

          Jens
          • 2. Re: Make fields in a layout un-editable when two fields are not identical
            TomM
              

            Jens, thanks for that. What I have done is added an extra text field called WriteLock which will be either "Locked" or "Open". Problem I have now is this...

             

            I'm trying to keep my records version controlled. That is, for a record with ID 123 there might be several versions, e.g. 1 of 3, 2 of 3, and 3 of 3. My WriteLock will not allow users to edit old versions (i.e. 1 of 3 and 2 of 3). They can only edit the latest version (in this case, version 3 of 3), as long as it hasn't been WriteLocked already. However, when coming to add a new Version, i.e. version 4, my existing scripts go through the existing versions and change the VersionOf parameter (in this case from 3 to 4). I.e.

             

            Version 1 of 3  -> Becomes -> Version 1 of 4

            Version 2 of 3  -> Becomes -> Version 2 of 4

            Version 3 of 3  -> Becomes -> Version 3 of 4 

            New record added -> Version 4 of 4

             

            This worked fine before I implemented the WriteLock, but now, the VersionOf values are not changed. I believe that this is because these versions are now writelocked and so changes cannot be made to them.

             

            So my question is this, can I have an exception to my WriteLock rule. I.e. Edits are only allowed if WriteLock="Open" OR if the field is called VersionOf.

             

            How could I do this?

             

            Thanks.

             

            Tom. 

            • 3. Re: Make fields in a layout un-editable when two fields are not identical
              Jens Teich
                 Run script with full access. See checkbox at bottom of script dialog.

              Jens