Documentation

OnAfterIBlockAdd

handler function(
 array &arFields
);
The event OnAfterIBlockAdd is called after adding new iblock by the method CIBlock::Add.

Parameters

ParameterDescription
arFields Array of fields for a new iblock. Additionally, the array element with "RESULT" contains the result (returned value) of the method CIBlock::Add and, in case of an error, the element with index "RESULT_MESSAGE" will contain error description.

Note:
The parameter(s) of this handler are references to the original variables. Hence, altering their values from within the handler causes changing values of the source variables passed to the handler.

See Also

Example of handler function:

<?
// file /bitrix/php_interface/init.php
// register the handler
AddEventHandler("iblock", "OnAfterIBlockAdd", Array("MyClass", "OnAfterIBlockAddHandler"));
class MyClass { // create the event handler OnAfterIBlockAdd function OnAfterIBlockAddHandler(&$arFields) { if($arFields["ID"]>0) AddMessage2Log("Write with code".$arFields["ID"]." added."); else AddMessage2Log("Error adding a record (".$arFields["RESULT_MESSAGE"].")."); } } ?>


© «Bitrix24», 2001-2022
Up