falkaholic Posted March 7, 2002 Posted March 7, 2002 Is there a more graceful way of using field validation to lock out changes to fields? I've heard this method of doing it, but it seems very ugly. You can still edit the text and it just warns you after you leave the field. As well the message is confusing to end users. What other methods of locking out changes use people dreamt up? (besides using 2 layouts of course)
Chuck Posted March 7, 2002 Posted March 7, 2002 I tend to use layouts to restrict editing access. I use the validation options as a backup. When a record is created, the user is taken to a layout where they can edit the information. After that, however, when the user needs to see the information, they're taken to a differently layout that looks almost the same, but some of the fields have a grey background instead of a white background to indicate that they aren't editable. And, obviously, access to the field is turned off in the Field Format dialog. Chuck
Vaughan Posted March 7, 2002 Posted March 7, 2002 Actually this is about the most elegant. The other ways are: 1) Create a "locked" layout and display this if the record is locked. Requires a very tight control over the user interface, duplication of layouts (one open, one locked) and locked layout cannot be used for Finds so the Find process needs to be scripted to change into an unlocked layout as well. 2) Put scripts in all fields that don't allow entry if the record is locked. Requires tight control over the interface and the Tab order needs to be removed from all fields -- a real bummer for some users. So record locking via validation is actually pretty quick and easy, and reasonably elegant. It allows entry into the fields it does not allow the changes to be saved which is a bit inelegant, but that's the only disadvantage compared with all the work involved with the other methods. I've used the script method a couple of times, before I found about about locking via validation. I'll probably be using validation in the future.
falkaholic Posted March 11, 2002 Author Posted March 11, 2002 hmm. The only worry in the error message, which won't make sense to users, but its way better then the others. One added twist tho, how can this applied to portals? I can use validation in the line items, but since I create new records through the portal.... fudge!
Vaughan Posted March 12, 2002 Posted March 12, 2002 Specify a custom error message for the validation field: "This record cannot be changed: click on the REVERT button to continue."
DykstrL Posted March 12, 2002 Posted March 12, 2002 Eric, I have a solution file to lock records using validation that works quite well and is ...fairly... elegant. If you want, I can email you a copy of the file.
falkaholic Posted March 12, 2002 Author Posted March 12, 2002 dykstrl: that would be great! [ March 12, 2002, 09:35 AM: Message edited by: eric f ]
Keith M. Davie Posted March 12, 2002 Posted March 12, 2002 "Is there a more graceful way of using field validation to lock out changes to fields?" ... "(besides using 2 layouts of course)" Why use field validation? Is not a calc field non-modifiable? Or why not format the field to disallow entry? What am I missing?
Fitch Posted March 12, 2002 Posted March 12, 2002 One alternative is to use 3 fields: DataEntry, where you enter and edit; DataLock, auto-enters the contents of DataEntry, but is NOT modifiable, and is not on any visible layout; DataWarning, a calc = Case (DataEntry DataLock, "Warning! Your changes will not be saved! Your DNA has been scanned and filed and the authorities have been alerted.") You get the idea... you could run a script every night that sets DataEntry to DataLock. I worked on a system something like this at a company where the sales staff were poaching each others' commissions. Too tempting to just change the salesperson's name... So we had to lock them out.
falkaholic Posted March 12, 2002 Author Posted March 12, 2002 Thats a good idea too. What I ended up doing in simple terms; is have a global number field, its 1 or 2 for locked and unlocked. Then have another global container with 2 repetitions that hold a graphic for locked and unlocked then have a calculation field that returns a container based on the locked global. Then place the calc field in any layouts i want it and make it a button that triggers and script to toggle the locked global. Then in each field i want lock and validate it by calc that is just "globalLock <> 2" and then have strict with message.
Vaughan Posted March 12, 2002 Posted March 12, 2002 Global fields work differently in multi-user environments: each user gets their own set. So if a user sets the record locked, it's not really locking the records permanently. IOW, I don't think this method with global fields will work.
falkaholic Posted March 13, 2002 Author Posted March 13, 2002 What I'm using it for it just for an "edit mode." where the is a toggle button that locks the editable fields so the user can't accidently modify fields. So a globals are the best choice since it will be used by 5 people at once. I also used this method on the invoice system but it locks the invoice when you competed it; using non-globals of course.
Recommended Posts
This topic is 8680 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now