mrlux
April 3, 2020, 2:35pm
1
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?
arbei
April 4, 2020, 2:31am
2
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”);
mrlux
April 4, 2020, 6:51am
3
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;