Problem with Edit with $this->Status->Disabled = TRUE;

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mpol_ch
User
Posts: 879
Location: Switzerland

Problem with Edit with $this->Status->Disabled = TRUE;

Post by mpol_ch »

Hello
I am using the following code for to disable the editig the stations of record for userlevel 1. It works. But when user edit any other value of recods then the value of Status is lost ( set to NULL).
How can a avoid this? The user should be able to edit all other values but not the Status. The Status are set Radio Button.
if ((CurrentUserLevel() == 1)) {
$this->Status->Disabled = TRUE;
}

mpol_ch


mobhar
User
Posts: 11792

Post by mobhar »

Simply insert the following code into your "Row_Updating" server event:

if ((CurrentUserLevel() == 1)) {
$rsnew["status"] = $rsold["status"];
}


mpol_ch
User
Posts: 879
Location: Switzerland

Post by mpol_ch »

Hello mobhar

thanks a lot. It works fine now.

mpol_ch


Post Reply