Row Deleting event
Posted: Thu Aug 01, 2024 7:56 pm
Hi,
I am using the following code to check the record before deleting it.
When the condition is "false" then it is freezing.
No message and no work for "cancel" button.
any idea?
// Row Deleting event
function Row_Deleting(&$rs)
{
// Check if the current user is not an admin and not the owner of the record
if (CurrentUserLevel() != -1 && CurrentUserID() != $rs["Code"]) {
$this->setFailureMessage("Sorry you are not the owner.");
return false; // Cancel the delete operation
} else {
return true; // Allow the delete operation
}
}
mpol_ch