Documentation

OnBeforeGroupUpdate

bool
EventHandler(
 int ID,
 array &arFields
);

The event is invoked in the method CGroup::Update before updating group fields. It can be used to cancel the update and to re-define specific fields.

Method parameters

Parameter Description
IDUpdated user group ID.
arFields List of (CGroup class) fields for the updated user group.

The parameter arFields passed to this handler function are references to original variables. Therefore, all changes to parameters made within the handler affect values of the original variables.

Returned value

To cancel user authorization and terminate the execution for the method CGroup::Update, throw an exception in the handler function via the method $APPLICATION->ThrowException() and return false.

See Also

Examples of use

<?
AddEventHandler("main", "OnBeforeGroupUpdate", "MyOnBeforeGroupUpdate");
public static function MyOnBeforeGroupUpdate($ID, &$arFields)
{
if($ID == 1)
$arFields["DESCRIPTION"] = "Main admin group.";
}
?>


© «Bitrix24», 2001-2024