"Edit" Mode - "locked" records

Support for our integrated Contact Manager, Calendar, and Project Tracker.
Posts: 27
Joined: Fri Sep 08, 2006 6:26 pm
Location: Oregon
PostPosted: Thu Dec 27, 2007 3:18 pm
Is there a way to lock records, so that in Browse Mode, a button needs to be pressed (i.e. script run) to "unlock" the record for editing. I have run into a problem with users changing an existing record rather than creating a new record. I want to be able to force them to think about what they are doing.

Thanks.

Marvin
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Thu Dec 27, 2007 3:36 pm
You'll use FileMaker's build in access privileges for this.

Begin by creating a field in the table you're interested in called "Locked". Make this a number field and add it to your layout formatted as a checkbox with a value list of "1". So when there is a "1" in the field "locked" the box will be checked. (Make the check box field short enough so you only see the box, not the "1".)

Now create a script that toggles "locked" something like this:

SetField [ Locked ; If ( Locked = 1 ; "" ; 1 ) ]
Commit Record / Request

Set this script to run with full access and make this checkbox a button which runs this script. (You may also want to disable entry to the checkbox field in browse mode.)

Now edit the Privilege Set for any users you'd like to have to respect this lock. Where it says "Records" switch that to "Custom Privileges"-- you'll be taken to a screen with detailed privileges for each table in your solution. Find the table you're interested in and change the "Edit" privilege to "limited...". The calc you can use would look like this:

Locked ≠ 1

In this way records will start out unlocked. Then, users can manually lock the record by clicking the check box. After they do so, they won't be able to edit the record until they click the box again to unlock the record.

Hope that helps.
John Sindelar
SeedCode

Return to SeedCode Calendar

Who is online

Users browsing this forum: No registered users and 1 guest

(855) SEEDCODE
[email protected]
Follow us: