Bitrix Site Manager

CFormStatus::Delete

bool
CFormStatus::Delete(
 int status_id,
 string check_rights = "Y"
)

The method Delete deletes a status. Returns true on success, or false otherwise.

Note!
Statuses containing at least one result can not be deleted.

Parameters

Parameter Description
status_id The ID of the status to be deleted.
check_rights Flag specifying the current user permissions should be checked. One of the following values is possible:
  • Y - permissions should be checked;
  • N - no checks need to be performed.
For this method to succeed, you should have the permission [30] full access for the destination web form containing the field status_id.
Optional. "Y" by default which means the permissions should be checked.

See Also

Example



<?
$status_id = 1; // The status ID
// delete the status
if (CFormStatus::Delete($status_id))
{
    echo "The status #1 has been deleted.";
}
else
{
    // display the error description
    global $strError;
    echo $strError;
}
?>