This topic is locked

Conditionally locking a record

6/26/2009 5:38:46 PM
ASPRunnerPro General questions
jtksmith author

I would like to have the functionality to lock a record on the "List" page so that it can no longer be Edited or Deleted depending on the condition of a checkbox. For example, if the "IsLocked" checkbox has been checked ("Yes" or 1) on a record, it can still appear in the List but the viewer would not have the option to Edit or Delete the record unless they have Admin rights.
I've tried to modify the example code used to prevent two people from editing the same record at the same time but was unable to make the code work.
Thanks in advance.

J
Jane 7/1/2009

Jeremy,
use List page: After record processed event on theEvents tab for this purpose.

Here is a sample:

if data("FieldName")=1 then

record("edit_link") = false

else

record("edit_link") = true

end if