Question

Locked

Locking a Field after editing

By ngu78 ·
How do I lock a specific field after editing (i.e. I have a list of consultants from a drop down list. I would like to lock a consultant to a particular record once the consultant has allocated that record to themselves. I don't want anyone else changing the consultant next to that record except myself, the administrator). Your help would be greatly appreciated. Cheers.

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Application logic

by Toivo Talikka In reply to Locking a Field after edi ...

You may need to build the controls to the logic in your code. Even if you could modify the access rights at the field level (depending on the database system), it may be too tricky to try to change the rights on the fly.

You may need a subroutine similar to this (in PHP):

function check_update($consultant_in_table, $logged_in_user, $administrator) {
$allow_update = FALSE;
if ($consultant_in_table == "") {
$allow_update = TRUE;
}
if ($logged_in_user == $administrator) {
$allow_update = TRUE;
}
return $allow_update;

Your code would set the input variables and test the value returned by the function when it needs to decide if the user can change the field.

Collapse -

Application Logic

by ngu78 In reply to Application logic

Thanks Toivo, it sounds like you know what you're talking about. Unfortunately I'm not a programmer and don't quite understand how to go about this. In the properties of the field in question, I've copied and pasted your script into the code builder but it doesn't seem to work. My table is called "Vendors". The field I wish to lock after editing is called "Broker". Do I also need to specify the exact users who are and aren't allowed to update this field? Thanks again for your help :)

Collapse -

Pseudocode

by Toivo Talikka In reply to Application Logic

My code was meant to be just pseudocode, demonstrating what could be done. You may want to apply similar logic, and the finer details may need someone's involvement who is familiar with the code builder you are using and the programming language it generates.

Back to Desktop Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums