array &arFields

The event fires in the method CGroup::Add before adding a group. It can be used to cancel the adding or to re-define specific fields.

Method parameters

Parameter Description
arFields List of (CGroup class) fields of the added user groups.

The parameter arFields passed to this handler function is the reference 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::Add, throw an exception in the handler function via the method $APPLICATION->ThrowException() and return false.

See Also

Examples of use

AddEventHandler("main", "OnBeforeGroupAdd", "MyOnBeforeGroupAdd");
public static function MyOnBeforeGroupAdd(&$arFields)
if($arFields["DESCRIPTION"] == '')
$arFields["DESCRIPTION"] = "Group description";

© «Bitrix24», 2001-2023