You could create a field, a few scripts and new layout.
Field: Layout_Lock Type: Number Storage: Global
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.
Set to on layout load.
Go to Layout (Layout created with just merge fields)
Else Go to Editable Layout. or Exit script
Create with just merge fields
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.
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
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.