5 Replies Latest reply on Oct 11, 2012 1:16 PM by philmodjunk

    Lock fields/table

    EP

      Title

      Lock fields/table

      Post

           Is there a way to lock fields or an entire table with a button? I'd like the fields to look like merge fields when locked and look like editable fields when unlocked. Thanks 

        • 1. Re: Lock fields/table
          MarcMcCall

               You could create a field, a few scripts and new layout.  

               Field: Layout_Lock Type: Number  Storage: Global

               Script One:

               If (yourtable::Layout_Lock)=1

               Set Field  yourtable::Layout_Lock Calculated Result: ""

               Else Set Field: yourtable::Layout_Lock Calculated Result: 1

               This would be for your button to lock and unlock the layout.

                

               Script 2 

               Set to on layout load.  

               If (youtable::Layout_Lock)=1

               Go to Layout (Layout created with just merge fields)

               Else Go to Editable Layout. or Exit script

                

               New Layout

               Create with just merge fields

          • 2. Re: Lock fields/table
            philmodjunk

                 I'm sure I answered this one already today, but don't see my first response.

                 If you open up Manage | security, you can set up the users' privilege set with limited access settings on the table, using a lock expression like this:

                 Globals::GlobalField = 1

                 If you set GlobalField to 1 the fields of that table can be edited. If you set it to any other value, it cannot be edited. You can use a global variable in place of the global field if you prefer.

                 Then conditional formatting can be used on the individual fields to change the appearance of the fields based on the value in the global field.

                 You can also use a script with the OnObjectEnter trigger to deny access to the fields when the value in the global field or variable indicates that the table is currently locked.

            • 3. Re: Lock fields/table
              Epa

                   I decided to go with Marc McCall's method, however I can't get it working.  Can someone take a look at my scripts? The lock button toggles from 1 to " "; I set the second script as a trigger on layout load.  When I click the lock button, nothing happens.  Thanks

              • 4. Re: Lock fields/table
                Epa
                /files/91dcdebf32/Snapshot_10%3A11%3A12_3%3A55_PM.png 790x550
                • 5. Re: Lock fields/table
                  philmodjunk

                       Nothing will happen when you click a button set to run the first script rxcept that the field's value will change. If you want the fields to be immediately locked by the button click, include a perform script step at the scipt's end that performs the second script to change to the appropriate layout.