Documentation

onBeforeResultDelete

функция-обработчик(
 int WEB_FORM_ID,
 int RESULT_ID,
 string(1) CHECK_RIGHTS
);
Event handlers are called before deleting webform result. This can be used, for example for sending additional notifications using email or for restricting result deletion. Handler is not designed to return any values. Errors can be returned via $APPLICATION->ThrowException().

Parameters

ParameterDescription
WEB_FORM_ID Webform ID.
RESULT_ID Result ID.
CHECK_RIGHTS Flag "Check permissions" (Y|N).

Handler function example:

public static function my_onBeforeResultDelete($WEB_FORM_ID, $RESULT_ID, $CHECK_RIGHTS)
{
  global $APPLICATION;
  
  // handler action applies only to the webform with ID=6
  if ($WEB_FORM_ID == 6 && $RESULT_ID == 1) 
  {
      $APPLICATION->ThrowException('This result cannot be deleted!');
  }
}

// register the function as event handler
AddEventHandler('form', 'onBeforeResultDelete', 'my_onBeforeResultDelete');


© «Bitrix24», 2001-2024