Documentation

OnAfterIBlockPropertyAdd

event_handler(
 array &arFields
);
The event OnAfterIBlockPropertyAdd is fired after an attempt to add a new information block property by a call to CIBlockProperty:Add.

Parameters

ParameterDescription
arFields An array of the new information block property fields.

The additional entry "RESULT" contains the value returned by the CIBlockProperty:Add method. If an error occurred during the method execution, the entry "RESULT_MESSAGE" contains the 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

  • OnBeforeIBlockPropertyAdd event
  • CIBlockProperty:Add
     
    <?
    // file /bitrix/php_interface/init.php
    // register handler
    AddEventHandler("iblock", "OnAfterIBlockPropertyAdd", Array("MyClass", "OnAfterIBlockPropertyAddHandler"));
    
    class MyClass
    {
        // create handler "OnAfterIBlockPropertyAdd"
        public static function OnAfterIBlockPropertyAddHandler(&$arFields)
        {
            if($arFields["RESULT"])
                AddMessage2Log("Redord ID=".
                               $arFields["ID"]." added.");
            else
                AddMessage2Log("Error adding record ".
                               $arFields["ID"].
                               " (".$arFields["RESULT_MESSAGE"].").");
        }
    }
    ?>
  • © «Bitrix24», 2001-2024
    Up