Documentation

Delete

bool
CFormResult::Delete(
 int result_id,
 string check_rights = "Y"
)

The method Delete deletes the specified result. Returns true on success, and false otherwise. Non-static method.

Parameters

Parameter Description
result_id ID of the result.
check_rights If set to "Y", current user access permissions must be checked. The following values are possible:
  • Y - access permissions must be checked;
  • N - access permissions must not be checked.
To successfully delete the result, the following access permissions are required:
  1. For the web form to which the result being edited belongs:

    [20] Handle all results according to their status

    or, if you are the author of the status to be deleted, the following permission is sufficiet:

    [15] Handle own result according to its status.
  2. For the status in which the currently edited result is:

    [DELETE] deletion.
Optional parameter. "Y" by default (check permissions).

See Also

Examples


<?
$RESULT_ID = 189; // result ID

// delete the result with the current user access permission check  
if (CFormResult::Delete($RESULT_ID))
{
    echo "The # ".$RESULT_ID." successfully deleted.";
}
else // error
{
    global $strError;
    echo $strError;
}
?>
© «Bitrix24», 2001-2024
Up