3 Replies Latest reply on Nov 17, 2015 1:23 PM by BillR_1

    Prevent changes in found records

    BillR_1

      How do I prevent users from changing data in records that show up as a found set? If I prevent entry to a field in find mode, the user can't search that field. If I prevent entry in browse mode, they can't enter new records. I'm sure there's an easy answer, but I haven't been able to find it.

      Thank you.

        • 1. Re: Prevent changes in found records
          coherentkris

          build separate view only and edit layouts is one way

          • 2. Re: Prevent changes in found records
            TorstenBernhard

            One method is to have a global field or a global variable for the lock status and verifying its value each time a user wants to modify a field.

             

            Here is an example:

            define the following scripts:

             

            AllowWrite

            Set Variable [$$dataLock; "Write"]

            Exit Script []


            LockWrite

            Set Variable [$$dataLock; "Locked"]

            Exit Script []

             

            UserAction

            If ($$dataLock = "Write")

                 Exit Script []

            Else if ($$dataLock = "Locked")

                 Revert Record/Request [No dialog]

            End if

            Exit Script []

             

            If a user shall not modify records, $$dataLock is set to "Lock" by calling LockWrite ()

            For each field to survey, set a script trigger

            OnObjectModify

            or

            OnObjectExit

            to trigger the script UserAction.


            If $$dataLock = "Locked", the user's modification will be reverted. It still allows to view data, including scrolling and copying content.

            If you wish to define the lock state on a per-record basis, define a field "dataLock" in the table and modify the above scripts accordingly.