This topic is locked

modify field once

3/20/2012 3:28:27 PM
PHPRunner General questions
B
bilboss author

as I can make a record is modified only once?

or that the field is modifiable only with value 0

when the field has a value greater than 0 can not be changed

thanks in advance

Sergey Kornilov admin 3/20/2012

You need to use Edit page: BeforeProcess event to check the value of that field. If field value is not 0 then display a message on the page and return false to prevent page from being displayed.
Other considerations:

  • make sure this field is not editable directly
  • set default value of this field to 0
  • in BeforeAdd event set this field value to 1 i.e.

$values["MyField"]=1;