Not update field for CurrentUserLevel = 0

In Edit Page → Page_DataRendering I use:
$levelid = CurrentUserLevel();
if ($levelid == 0)
$this->status_admin->Visible = FALSE;

Field status_admin stay invisible for UserLevel = 0, but this field update in DB. How to make this field not change when editing?

If the field can be viewed by user, you may use Disabled instead of Visible property. If you want the field to be invisible, you need to add code in Row_Updating server event, e.g.

unset($rsnew[“status_admin”);

Thank you! Below is the complete solution.

// Table-Specific → Edit Page → Page_Load
$levelid = CurrentUserLevel();
if ($levelid == 0)
$this->status_admin->Disabled = TRUE;

and

// Table-Specific → Common → Row_Updating
$levelid = CurrentUserLevel();
if ($levelid == 0)
unset($rsnew[“status_admin”]);
return TRUE;