handler function(
 array &arFields
The event OnAfterIBlockElementUpdate is called after an iblock element updating attempt by the method CIBlockElement::Update. The event operates independently from direct create/modify actions that are performed on elements - that is why the parameter RESULT_MESSAGE. must be checked additionally:


arFields Array of fields of the modified iblock element. Additionally, the array element with index "RESULT" contains the result (returned value) of the method CIBlockElement::Update and, in case of an error, the element with index "RESULT_MESSAGE" will contain error description.

Array of element fields is passed via reference. Any handling of this array within an event handler won't modify information about iblock element, saved in the database. However when the system has several event handlers, each subsequent event handler will receive an array with modifications.

See Also

Examples of handler function:

// file /bitrix/php_interface/init.php
// register the handler
AddEventHandler("iblock", "OnAfterIBlockElementUpdate", Array("MyClass", "OnAfterIBlockElementUpdateHandler"));
class MyClass { // create the event handler OnAfterIBlockElementUpdate function OnAfterIBlockElementUpdateHandler(&$arFields) { if($arFields["RESULT"]) AddMessage2Log("Record with code ".$arFields["ID"]." modified."); else AddMessage2Log("Failed to modify the record ".$arFields["ID"]." (".$arFields["RESULT_MESSAGE"].")."); } } ?>

© «Bitrix24», 2001-2022